summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries/MY_View.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-07-29 19:37:38 -0700
committerBharat Mediratta <bharat@menalto.com>2010-07-29 19:37:38 -0700
commitebbb73787d6f935354478d4bdbe626c163c90a9c (patch)
treef2ce230622b387396b2a5a64d46a0c4e28653ee4 /modules/gallery/libraries/MY_View.php
parent941a350691c267e3b417eb461bdc9d499ee10598 (diff)
Trap ORM_Validation_Exception specially and report which fields failed validation.
Diffstat (limited to 'modules/gallery/libraries/MY_View.php')
-rw-r--r--modules/gallery/libraries/MY_View.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/gallery/libraries/MY_View.php b/modules/gallery/libraries/MY_View.php
index d76e25ff..ded77792 100644
--- a/modules/gallery/libraries/MY_View.php
+++ b/modules/gallery/libraries/MY_View.php
@@ -67,6 +67,10 @@ class View extends View_Core {
try {
$this->kohana_local_data = array_merge(View::$global_data, $this->kohana_local_data);
return parent::render($print, $renderer, $modifier);
+ } catch (ORM_Validation_Exception $e) {
+ Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString());
+ Kohana_Log::add("error", "Validation errors: " . print_r($e->validation->errors(), 1));
+ return "";
} catch (Exception $e) {
Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString());
return "";