diff options
author | Malf Furious <m@lfurio.us> | 2017-02-05 00:42:29 -0500 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2017-02-05 00:42:29 -0500 |
commit | 9642aeb3b2fa76fd21a4fa0878bc226f6ff013a5 (patch) | |
tree | 8f98d2c58054a47f57855464402797add647bda2 /app | |
parent | 19fac440ae8cf1a03e491825fb7d33313c451caa (diff) | |
download | scrott-9642aeb3b2fa76fd21a4fa0878bc226f6ff013a5.tar.gz scrott-9642aeb3b2fa76fd21a4fa0878bc226f6ff013a5.zip |
Remove custom exception 'databasekeyexception'
Just use a generic exception in these cases. I don't want to handle
these any differently, and just fall back on the main Exception() error
page once we get to a UI.
Diffstat (limited to 'app')
-rw-r--r-- | app/class/table.class.php | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/app/class/table.class.php b/app/class/table.class.php index 0edff9d..be7a375 100644 --- a/app/class/table.class.php +++ b/app/class/table.class.php @@ -13,7 +13,6 @@ */ require_once "class/database.class.php"; -require_once "class/databasekeyexception.class.php"; /* * This class provides functionality for retrieving data from and updating @@ -34,10 +33,9 @@ abstract class table /* * Instanciate an object representing an existing database entity - * named by the given GUID. If no such GUID exists, a - * databasekeyexception is thrown. If NULL is passed, no database - * lookups are attempted. This is helpful for assembling new database - * objects. + * named by the given GUID. If no such GUID exists, an exception + * is thrown. If NULL is passed, no database lookups are attempted. + * This is helpful for assembling new database objects. */ public function __construct(?string $guid = NULL) { @@ -50,14 +48,14 @@ abstract class table /* * This function will iterate the $fields array and initialize this * object's class properties based on the table=>fields mapping. If - * no such GUID exists, a databasekeyexception is thrown. + * no such GUID exists, an exception is thrown. */ private function loadObj(string $guid) : void { $guid = $this->db->esc($guid); if (!$this->isGUID($guid)) - throw new databasekeyexception("GUID " . $guid . " does not exist"); + throw new Exception("GUID " . $guid . " does not exist"); foreach ($this->fields as $tbl => $flds) { @@ -145,12 +143,12 @@ abstract class table /* * This function will remove this object from the database by deleting * rows with this object's GUID from tables in $fields. If this object - * does not have a GUID, throw a databasekeyexception. + * does not have a GUID, throw an exception. */ public function delObj() : void { if (!isset($this->guid)) - throw new databasekeyexception("GUID (null) does not exist"); + throw new Exception("GUID (null) does not exist"); $guid = $this->db->esc($this->guid); |