summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/task.php
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-02-02 02:59:20 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-02-02 02:59:20 +0000
commit9d0927dda936756f1f5003813f437d714fe481f8 (patch)
treefe1b887345b37387ab0ddcfd78bf344f6150b6cc /modules/gallery/helpers/task.php
parenta6f794c20dc3592bcaef17c622413c1b670a20d8 (diff)
parent43985ea2fb137aa7d532617271e37d7c20def3c5 (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers/task.php')
-rw-r--r--modules/gallery/helpers/task.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/gallery/helpers/task.php b/modules/gallery/helpers/task.php
index 4aa95f33..645850d1 100644
--- a/modules/gallery/helpers/task.php
+++ b/modules/gallery/helpers/task.php
@@ -84,8 +84,15 @@ class task_Core {
}
$task->save();
} catch (Exception $e) {
- Kohana_Log::add("error", $e->__toString());
- $task->log($e->__toString());
+ Kohana_Log::add("error", (string)$e);
+
+ // 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((string)$e);
$task->state = "error";
$task->done = true;
$task->status = substr($e->getMessage(), 0, 255);