Skip to content
Snippets Groups Projects
Verified Commit 995e5dfd authored by Alexandre Morin's avatar Alexandre Morin
Browse files

Fix : #7268

parent 1973bb25
No related branches found
No related tags found
3 merge requests!38Hotfix/2.1.1,!37Hotfix/2.1.1,!36Hotfix/2.1.1
......@@ -94,7 +94,11 @@ class Exception
if (isset($exception->errors)) {
$errors = [];
foreach ($exception->errors as $error) {
if (is_object($error)) {
if (is_string($error)) {
$error = new \core\Error($error);
}
if (is_object($error) && $error instanceof \core\Error) {
$error->setMessage($this->translator->getText($error->getFormat()));
$variables = [];
......@@ -108,10 +112,8 @@ class Exception
}
}
$error->setVariables($variables);
} else {
$error = new \core\Error($error);
$errors[] = $error;
}
$errors[] = $error;
}
$this->json->errors = $errors;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment