From: Brion Vibber Date: Wed, 24 Feb 2010 01:09:12 +0000 (+0000) Subject: Add class and (if present) id to DB_DataObject error exceptions; often they're VERRRR... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2aaf8d4e308d49d072a6c43e43cb99c373deca2e;p=quix0rs-gnu-social.git Add class and (if present) id to DB_DataObject error exceptions; often they're VERRRRRY vague, and it helps to know what type of item is failing! --- diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 40576dc717..bc4c3a000c 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -501,7 +501,11 @@ class Memcached_DataObject extends Safe_DataObject function raiseError($message, $type = null, $behaviour = null) { - throw new ServerException("DB_DataObject error [$type]: $message"); + $id = get_class($this); + if ($this->id) { + $id .= ':' . $this->id; + } + throw new ServerException("[$id] DB_DataObject error [$type]: $message"); } static function cacheGet($keyPart)