summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-30 16:19:00 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-30 16:19:00 -0800
commitdccb2b73ffe205e359eeea57e4c7c52e584eccc5 (patch)
tree6a6ba2c4d8a33a72e2ec57a8ec8c5b0ecfc7fb33
parent10e208ea5c1a98d509a520a5bd2cbd407ae2268a (diff)
Dump out validation errors so that we have some extra information in the logs.
-rw-r--r--modules/gallery/libraries/MY_Kohana_Exception.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/gallery/libraries/MY_Kohana_Exception.php b/modules/gallery/libraries/MY_Kohana_Exception.php
index dd5998a1..1c40091a 100644
--- a/modules/gallery/libraries/MY_Kohana_Exception.php
+++ b/modules/gallery/libraries/MY_Kohana_Exception.php
@@ -28,4 +28,11 @@ class Kohana_Exception extends Kohana_Exception_Core {
$e->getFile(), $e->getLine(),
$e->getTraceAsString());
}
+
+ public static function handle(Exception $e) {
+ if ($e instanceof ORM_Validation_Exception) {
+ Kohana_Log::add("error", "Validation errors: " . print_r($e->validation->errors(), 1));
+ }
+ return parent::handle($e);
+ }
} \ No newline at end of file