{"issue":{"milestone":null,"title":"Formo doesn't catch ORM_Validation_Exception","created_at":"2011-12-30T09:26:29Z","user":{"login":"d4rky-pl","id":284395,"url":"https://api.github.com/users/d4rky-pl","avatar_url":"https://secure.gravatar.com/avatar/fa65ee3d6d65b73c7167f3331cbeeeec?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"fa65ee3d6d65b73c7167f3331cbeeeec"},"updated_at":"2011-12-30T09:28:39Z","state":"open","labels":[],"id":2687494,"closed_at":null,"html_url":"https://github.com/bmidget/kohana-formo/issues/160","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"As far as I understand, Formo has it's own error-handling system. However in the latest version from repository, it doesn't catch errors from ORM, and rather than that, it allow ORM_Validation_Exception to be uncaught.\r\n\r\nExample code:\r\n\r\n    try\r\n    {\r\n        if($form->load($_POST)->validate()) // <- THIS\r\n        {\r\n            if($this->_create_passed($form, $element))\r\n            {\r\n                $element->save();\r\n                $form->orm('save_rel', $element);\r\n\r\n                $this->request->redirect(Route::get($this->_route_name)->uri(array('controller'=> Request::current()->controller())));\r\n            }\r\n        }\r\n        else\r\n        {\r\n            $this->_create_failed($form, $element);\r\n        }\r\n    }\r\n    catch(ORM_Validation_Exception $e) \r\n    { \r\n        echo Debug::vars($e->errors()); \r\n    }\r\n\r\nReturns:\r\n\r\n    array(1) (\r\n        \"id\" => array(2) (\r\n            0 => string(9) \"not_empty\"\r\n            1 => array(1) (\r\n                0 => NULL\r\n            )\r\n        )\r\n    )\r\n","number":160,"url":"https://api.github.com/repos/bmidget/kohana-formo/issues/160","comments":1,"assignee":null},"comment":{"created_at":"2011-12-30T09:28:39Z","user":{"login":"d4rky-pl","id":284395,"url":"https://api.github.com/users/d4rky-pl","avatar_url":"https://secure.gravatar.com/avatar/fa65ee3d6d65b73c7167f3331cbeeeec?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"fa65ee3d6d65b73c7167f3331cbeeeec"},"updated_at":"2011-12-30T09:28:39Z","id":3311990,"body":"Additional info: id is set to editable = false, render = false. If this is expected behaviour, it should be noted in docs.","url":"https://api.github.com/repos/bmidget/kohana-formo/issues/comments/3311990"},"action":"created"}