diff options
author | Evan Prodromou <evan@status.net> | 2010-08-10 23:36:13 -0700 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-08-10 23:36:13 -0700 |
commit | 41dfea163460bb216483e8e12fff7a8afefbb4fb (patch) | |
tree | 8049f397c1a39b1a49a7a0d3d6eac707f5f13e14 /classes/Memcached_DataObject.php | |
parent | 3062cc270607ad60993e5e6d6e3977fab74508b0 (diff) | |
parent | 5c210f724a865830d0c39feba8386f495b18ee4f (diff) |
Merge branch 'master' of gitorious.org:statusnet/mainline
Diffstat (limited to 'classes/Memcached_DataObject.php')
-rw-r--r-- | classes/Memcached_DataObject.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index a7fec365e..0f1ed0489 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -235,6 +235,7 @@ class Memcached_DataObject extends Safe_DataObject $pkey[] = $key; $pval[] = self::valueString($this->$key); } else { + // Low level exception. No need for i18n as discussed with Brion. throw new Exception("Unknown key type $key => $type for " . $this->tableName()); } } @@ -282,6 +283,7 @@ class Memcached_DataObject extends Safe_DataObject } else if ($type == 'fulltext') { $search_engine = new MySQLSearch($this, $table); } else { + // Low level exception. No need for i18n as discussed with Brion. throw new ServerException('Unknown search type: ' . $type); } } else { @@ -527,7 +529,8 @@ class Memcached_DataObject extends Safe_DataObject } if (!$dsn) { - throw new Exception("No database name / dsn found anywhere"); + // TRANS: Exception thrown when database name or Data Source Name could not be found. + throw new Exception(_("No database name or DSN found anywhere.")); } return $dsn; @@ -571,12 +574,13 @@ class Memcached_DataObject extends Safe_DataObject function raiseError($message, $type = null, $behaviour = null) { $id = get_class($this); - if ($this->id) { + if (!empty($this->id)) { $id .= ':' . $this->id; } if ($message instanceof PEAR_Error) { $message = $message->getMessage(); } + // Low level exception. No need for i18n as discussed with Brion. throw new ServerException("[$id] DB_DataObject error [$type]: $message"); } @@ -619,9 +623,11 @@ class Memcached_DataObject extends Safe_DataObject case 'sql': case 'datetime': case 'time': + // Low level exception. No need for i18n as discussed with Brion. throw new ServerException("Unhandled DB_DataObject_Cast type passed as cacheKey value: '$v->type'"); break; default: + // Low level exception. No need for i18n as discussed with Brion. throw new ServerException("Unknown DB_DataObject_Cast type passed as cacheKey value: '$v->type'"); break; } |