]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib-php/init-website.php
export UsageError and Configuration in api directly
[nominatim.git] / lib-php / init-website.php
index 770c245d4be3648db262b171e7d385e1b023d416..60367503a9bd787aa236d540163f21f6a311d58e 100644 (file)
@@ -26,7 +26,7 @@ function userError($sMsg)
 
 function exception_handler_json($exception)
 {
-    http_response_code($exception->getCode());
+    http_response_code($exception->getCode() == 0 ? 500 : $exception->getCode());
     header('Content-type: application/json; charset=utf-8');
     include(CONST_LibDir.'/template/error-json.php');
     exit();
@@ -34,7 +34,7 @@ function exception_handler_json($exception)
 
 function exception_handler_xml($exception)
 {
-    http_response_code($exception->getCode());
+    http_response_code($exception->getCode() == 0 ? 500 : $exception->getCode());
     header('Content-type: text/xml; charset=utf-8');
     echo '<?xml version="1.0" encoding="UTF-8" ?>'."\n";
     include(CONST_LibDir.'/template/error-xml.php');