summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-02-24 01:09:12 +0000
committerBrion Vibber <brion@pobox.com>2010-02-24 01:09:12 +0000
commit2aaf8d4e308d49d072a6c43e43cb99c373deca2e (patch)
treeadc7cce09b21bad1293e17231aa082aada4c35b9 /classes
parent391b45949f6fabef0427aa99d4123fe6ef5ef49d (diff)
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!
Diffstat (limited to 'classes')
-rw-r--r--classes/Memcached_DataObject.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php
index 40576dc71..bc4c3a000 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)