made errors generic

This commit is contained in:
AlbusRex 2023-10-11 19:00:37 +02:00
parent 151cc8f7b6
commit 97781a229b
1 changed files with 3 additions and 3 deletions

View File

@ -114,7 +114,7 @@ if (startsWith($path, "/maps/")) {
try {
$sql = new PDO("$driver:host=$hostname;dbname=$database", $username, $password);
$sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e ) { error(500, "$e"); }
} catch (PDOException $e ) { error(500, "Failed to connect to database"); }
// provide map-tiles
@ -163,7 +163,7 @@ if (startsWith($path, "/maps/")) {
exit;
}
} catch (PDOException $e) { error(500, "$e"); }
} catch (PDOException $e) { error(500, "Failed to fetch data"); }
// empty json response if nothing found
header("Content-Type: application/json");
@ -191,7 +191,7 @@ if (startsWith($path, "/maps/")) {
fpassthru($line["value"]);
exit;
}
} catch (PDOException $e) { error(500, "$e"); }
} catch (PDOException $e) { error(500, "Failed to fetch data"); }
}