From ebbb73787d6f935354478d4bdbe626c163c90a9c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 29 Jul 2010 19:37:38 -0700 Subject: Trap ORM_Validation_Exception specially and report which fields failed validation. --- modules/gallery/libraries/MY_View.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules') 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 ""; -- cgit v1.2.3