# HG changeset patch # User Tom Fredrik "BFG" Klaussen # Date 1350312809 -7200 # Node ID 590e6950fa7fe8273147155e39a0d6da5474ef38 # Parent 3a1e20a5b67ae5bc5597cb8eb46376c0a4921e1b# Parent 2a8e2f571b246c315816a1b25bc7e68f69785c33 Branch merge. diff -r 2a8e2f571b24 -r 590e6950fa7f StatusCodes.inc --- a/StatusCodes.inc Fri Oct 12 18:24:06 2012 +0200 +++ b/StatusCodes.inc Mon Oct 15 16:53:29 2012 +0200 @@ -303,7 +303,7 @@ $matches = array(); preg_match('/HTTP\/\S+\s(\d+)/', $header, $matches); if (count($matches) < 1) - throw new Exception("Not an http header"); + throw new InvalidArgumentException("Not an http header"); $n = $matches[1]; return $n; } diff -r 2a8e2f571b24 -r 590e6950fa7f common-functions.inc --- a/common-functions.inc Fri Oct 12 18:24:06 2012 +0200 +++ b/common-functions.inc Mon Oct 15 16:53:29 2012 +0200 @@ -155,7 +155,7 @@ function getElementByTagName($obj, $name) { $elems = $obj->getElementsByTagName($name); if ($elems->length != 1) { - throw new Exception("More than one tag with name \"${name}\""); + throw new UnexpectedValueException("More than one tag with name \"${name}\""); } $elem = $elems->item(0); return $elem; diff -r 2a8e2f571b24 -r 590e6950fa7f flag.php --- a/flag.php Fri Oct 12 18:24:06 2012 +0200 +++ b/flag.php Mon Oct 15 16:53:29 2012 +0200 @@ -11,6 +11,11 @@ $scriptCache = ScriptIncludeCache::instance(__FILE__); $scriptCache->includeOnce('Flag.inc'); -$flag = new Flag($scriptCache); -$flag->genPage(); +try { + $flag = new Flag($scriptCache); + $flag->genPage(); +} +catch (Exception $e) { + errorPage($e, StatusCodes::HTTP_INTERNAL_SERVER_ERROR); +} /// @endcond diff -r 2a8e2f571b24 -r 590e6950fa7f index.php --- a/index.php Fri Oct 12 18:24:06 2012 +0200 +++ b/index.php Mon Oct 15 16:53:29 2012 +0200 @@ -23,9 +23,8 @@ } try { -$input = new InputParser(basePath() . "/master.xml", $cache); - -$input->genPage(); + $input = new InputParser(basePath() . "/master.xml", $cache); + $input->genPage(); } catch (Exception $e) { errorPage($e, StatusCodes::HTTP_INTERNAL_SERVER_ERROR); diff -r 2a8e2f571b24 -r 590e6950fa7f sitemap.php --- a/sitemap.php Fri Oct 12 18:24:06 2012 +0200 +++ b/sitemap.php Mon Oct 15 16:53:29 2012 +0200 @@ -11,7 +11,12 @@ $cache = ScriptIncludeCache::instance(__FILE__); $cache->includeOnce('Sitemap.inc', dirname(__FILE__)); -$sitemap = new Sitemap("master.xml"); -$sitemap->genPage(); +try { + $sitemap = new Sitemap("master.xml"); + $sitemap->genPage(); +} +catch (Exception $e) { + errorPage($e, StatusCodes::HTTP_INTERNAL_SERVER_ERROR); +} /// @endcond ?>