diff options
Diffstat (limited to 'search.php')
| -rw-r--r-- | search.php | 13 | 
1 files changed, 7 insertions, 6 deletions
@@ -22,20 +22,20 @@ function getConfig()          throw new Exception('File config.ini does not exist');      }      if (!$config = parse_ini_file("config.ini")) { -        throw new Exception('Could not parse ini file'); +        throw new Exception('Could not parse ini file', 1);      }      if (!isset($config["url"])) { -        throw new Exception('`url` not found in ini file'); +        throw new Exception('`url` not found in ini file', 1);      }      if (!isset($config["command"])) { -        throw new Exception('`command` not found in ini file'); +        throw new Exception('`command` not found in ini file', 1);      }      // Set default page size if it's not in the config      if (!isset($config["pagesize"])) {          $config["pagesize"] = 3;      } elseif (!is_int((int)$config["pagesize"]) || $config["pagesize"] < 1) { -        throw new Exception('Page size ' . $config["pagesize"]  . ' not valid in config'); +        throw new Exception('Page size ' . $config["pagesize"]  . ' not valid in config', 1);      }      // hash the password      if (isset($config['password'])) { @@ -67,7 +67,8 @@ function getJsonFromUrl($config)              "Could not retrive JSON from http server `"              . $config["url"]              . "?format=json` using password=" -            . (isset($config["hash"]) ? "true" : "false") +            . (isset($config["hash"]) ? "true" : "false"), +            1          );      }      return $output; @@ -275,5 +276,5 @@ try {      output($out);  } catch (Exception $e) { -    output($e->getMessage(), " - ", true); +    output($e->getMessage(), " - ", ($e->getCode() == 1));  }  | 
