mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
Merge pull request #1150 from pv2b/improve-validation-exception
(BaseModel) Always log the class where validation failed
This commit is contained in:
commit
87d2cc6fe5
@ -469,9 +469,10 @@ abstract class BaseModel
|
||||
if ($messages->count() > 0) {
|
||||
$exception_msg = "";
|
||||
foreach ($messages as $msg) {
|
||||
$exception_msg .= "[".$msg-> getField()."] ".$msg->getMessage()."\n";
|
||||
$exception_msg_part = "[".str_replace("\\", ".", get_class($this)).".".$msg-> getField(). "] " .$msg->getMessage();
|
||||
$exception_msg .= "$exception_msg_part\n";
|
||||
// always log validation errors
|
||||
$logger->error(str_replace("\\", ".", get_class($this)).".".$msg-> getField(). " " .$msg->getMessage());
|
||||
$logger->error($exception_msg_part);
|
||||
}
|
||||
if (!$disable_validation) {
|
||||
throw new \Phalcon\Validation\Exception($exception_msg);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user