summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-24 11:40:01 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-24 11:40:01 -0800
commitca5f625a5e3dc2fc26136b5dea8f27251f92c7c4 (patch)
treec535c3e38a6dd9bcb47c2a399a03be35b07f590d
parenta60969401852ddda878bd2a3444d6378899d4dcc (diff)
Log validation errors.
-rw-r--r--modules/gallery/helpers/task.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/gallery/helpers/task.php b/modules/gallery/helpers/task.php
index 4aa95f33..ad756ecd 100644
--- a/modules/gallery/helpers/task.php
+++ b/modules/gallery/helpers/task.php
@@ -85,6 +85,13 @@ class task_Core {
$task->save();
} catch (Exception $e) {
Kohana_Log::add("error", $e->__toString());
+
+ // Ugh. I hate to use instanceof, But this beats catching the exception separately since
+ // we mostly want to treat it the same way as all other exceptions
+ if ($e instanceof ORM_Validation_Exception) {
+ Kohana_Log::add("error", "Validation errors: " . print_r($e->validation->errors(), 1));
+ }
+
$task->log($e->__toString());
$task->state = "error";
$task->done = true;