diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-07-29 19:37:38 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-07-29 19:37:38 -0700 |
commit | ebbb73787d6f935354478d4bdbe626c163c90a9c (patch) | |
tree | f2ce230622b387396b2a5a64d46a0c4e28653ee4 | |
parent | 941a350691c267e3b417eb461bdc9d499ee10598 (diff) |
Trap ORM_Validation_Exception specially and report which fields failed validation.
-rw-r--r-- | modules/gallery/libraries/MY_View.php | 4 |
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 ""; |