summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/simple_uploader.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-16 12:00:50 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-16 12:00:50 -0800
commitefdb73cb986002806dfe3c9241f792652e4b56fa (patch)
tree847beb57eda4317800ce22d404852b8a582d7912 /modules/gallery/controllers/simple_uploader.php
parentb5a6a6a5d5741f592d504b8a444899964101b6b6 (diff)
Make movie creation use model based validation. Move movie related
logic from movie::create() into Item_Model
Diffstat (limited to 'modules/gallery/controllers/simple_uploader.php')
-rw-r--r--modules/gallery/controllers/simple_uploader.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/gallery/controllers/simple_uploader.php b/modules/gallery/controllers/simple_uploader.php
index 7a7e7557..16d1d241 100644
--- a/modules/gallery/controllers/simple_uploader.php
+++ b/modules/gallery/controllers/simple_uploader.php
@@ -79,6 +79,13 @@ class Simple_Uploader_Controller extends Controller {
} catch (Exception $e) {
// The Flash uploader has no good way of reporting complex errors, so just keep it simple.
Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString());
+
+ // 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));
+ }
+
if (file_exists($temp_filename)) {
unlink($temp_filename);
}