X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/8a796db3c974c55de8d59f3682a149e3642e6952..bb1c3f23abe70a618851bdda27e8410b59ab7faf:/lib/init-website.php
diff --git a/lib/init-website.php b/lib/init-website.php
index 9d66a9ac..967c6cce 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 "