diff common-functions.inc @ 83:ff5fc61aa5ea

Throw only specific exceptions, eg. non of type Exception base.
author Tom Fredrik "BFG" Klaussen <bfg@blenning.no>
date Mon, 15 Oct 2012 16:52:28 +0200
parents 947d53f95ccd
children 7a9c45b53866
line wrap: on
line diff
--- a/common-functions.inc	Mon Oct 15 16:51:07 2012 +0200
+++ b/common-functions.inc	Mon Oct 15 16:52:28 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;