Dump out validation errors so that we have some extra information in the logs.

This commit is contained in:
Bharat Mediratta
2010-01-30 16:19:00 -08:00
parent 10e208ea5c
commit dccb2b73ff

View File

@@ -28,4 +28,11 @@ class Kohana_Exception extends Kohana_Exception_Core {
$e->getFile(), $e->getLine(),
$e->getTraceAsString());
}
public static function handle(Exception $e) {
if ($e instanceof ORM_Validation_Exception) {
Kohana_Log::add("error", "Validation errors: " . print_r($e->validation->errors(), 1));
}
return parent::handle($e);
}
}