X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/797c2d1e74a14d8d52d963f1efad9be53fca5f5f..c3940466b817a4c10a956f61c43d6bee3214dd40:/lib/init-website.php?ds=sidebyside
diff --git a/lib/init-website.php b/lib/init-website.php
index 9d66a9ac..7d5cef1a 100644
--- a/lib/init-website.php
+++ b/lib/init-website.php
@@ -1,104 +1,100 @@
getMessage();
-
- echo << Nominatim has encountered an internal error while accessing the database.
- This may happen because the database is broken or because of a bug in
- the software. If you think it is a bug, feel free to report
- it over on
- Github. Please include the URL that caused the problem and the
- complete error details below. Message: $sMsg SQL Error: $sSqlError Details: Nominatim has encountered an internal error while accessing the database.
+ This may happen because the database is broken or because of a bug in
+ the software. If you think it is a bug, feel free to report
+ it over on
+ Github. Please include the URL that caused the problem and the
+ complete error details below. Message: $sMsg SQL Error: $sSqlError Details: Internal Server Error
-
+
+
+function chksql($oSql, $sMsg = "Database request failed")
+{
+ if (!PEAR::isError($oSql)) return $oSql;
+
+ header('HTTP/1.0 500 Internal Server Error');
+ header('Content-type: text/html; charset=utf-8');
+
+ $sSqlError = $oSql->getMessage();
+
+ echo <<
Internal Server Error
+
INTERNALFAIL;
- if (CONST_Debug)
- {
- var_dump($oSql);
- }
- else
- {
- echo "
\n".$oSql->getUserInfo()."
";
- }
-
- echo "
Nominatim has encountered an internal error while processing your request. This is most likely because of a bug in the software.
'; - echo "Details: ".$sError,"
"; - echo 'Feel free to file an issue on Github. Please include the error message above and the URL you used.
'; - if (CONST_Debug) - { - echo "".$sSQL."
";
- }
- if ($vDumpVar)
- {
- echo "";
- var_dump($vDumpVar);
- echo "
";
- }
- }
- echo "\n\n";
- exit;
- }
-
-
- function userError($sError)
- {
- header('HTTP/1.0 400 Bad Request');
- header('Content-type: text/html; charset=utf-8');
- echo "Nominatim has encountered an error with your request.
'; - echo "Details: ".$sError."
"; - echo 'If you feel this error is incorrect feel file an issue on Github. Please include the error message above and the URL you used.
'; - echo "\n\n"; - exit; - } + if (CONST_Debug) { + var_dump($oSql); + } else { + echo "\n".$oSql->getUserInfo().""; + } + + echo "