diff --git a/BlueMapCommon/webapp/public/sql.php b/BlueMapCommon/webapp/public/sql.php index 649a2361..5cd1cbd8 100644 --- a/BlueMapCommon/webapp/public/sql.php +++ b/BlueMapCommon/webapp/public/sql.php @@ -150,7 +150,8 @@ if (startsWith($path, "/maps/")) { $sql = new PDO("$driver:host=$hostname;port=$port;dbname=$database", $username, $password); $sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e ) { - error(500, "Failed to connect to database: ".$e->getMessage()); + error_log($e->getMessage(), 0); // Logs the detailed error message + error(500, "Failed to connect to database"); } // provide map-tiles @@ -201,7 +202,10 @@ if (startsWith($path, "/maps/")) { exit; } - } catch (PDOException $e) { error(500, "Failed to fetch data: ".$e->getMessage()); } + } catch (PDOException $e) { + error_log($e->getMessage(), 0); + error(500, "Failed to fetch data"); + } // no content if nothing found http_response_code(204); @@ -240,7 +244,10 @@ if (startsWith($path, "/maps/")) { send($line["data"]); exit; } - } catch (PDOException $e) { error(500, "Failed to fetch data: ".$e->getMessage()); } + } catch (PDOException $e) { + error_log($e->getMessage(), 0); + error(500, "Failed to fetch data"); + } } }