-$iWordID = $oDB->getOne("select word_id,word_token, word, class, type, country_code, operator, search_name_count from word where word_token in (' a')");
-if (PEAR::isError($iWordID)) {
- statusError("Query failed");
+
+try {
+ $oStatus = new Nominatim\Status($oDB);
+ $oStatus->status();
+} catch (Exception $oErr) {
+ if ($sOutputFormat == 'json') {
+ $aResponse = array(
+ 'status' => $oErr->getCode(),
+ 'message' => $oErr->getMessage()
+ );
+ javascript_renderData($aResponse);
+ } else {
+ header('HTTP/1.0 500 Internal Server Error');
+ echo 'ERROR: '.$oErr->getMessage();
+ }
+ exit;