Skip to content

Commit

Permalink
Fix warnings in exception render plugin (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnizzardini authored Nov 19, 2022
1 parent 9951a1e commit ad4c4aa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/exception-render/src/MixerApiExceptionRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,20 @@ public function render(): ResponseInterface
}
$response = $response->withStatus($code);

$exceptions = [$exception];
$previous = $exception->getPrevious();
while ($previous != null) {
$exceptions[] = $previous;
$previous = $previous->getPrevious();
}

$viewVars = [
'exception' => (new ReflectionClass($exception))->getShortName(),
'message' => $message,
'url' => h($url),
'code' => $code,
'error' => $exception,
'exceptions' => $exceptions,
];

if ($this->error instanceof ValidationException) {
Expand Down

0 comments on commit ad4c4aa

Please sign in to comment.