Skip to content

Commit ad4c4aa

Browse files
authored
Fix warnings in exception render plugin (#128)
1 parent 9951a1e commit ad4c4aa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

plugins/exception-render/src/MixerApiExceptionRenderer.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,20 @@ public function render(): ResponseInterface
7171
}
7272
$response = $response->withStatus($code);
7373

74+
$exceptions = [$exception];
75+
$previous = $exception->getPrevious();
76+
while ($previous != null) {
77+
$exceptions[] = $previous;
78+
$previous = $previous->getPrevious();
79+
}
80+
7481
$viewVars = [
7582
'exception' => (new ReflectionClass($exception))->getShortName(),
7683
'message' => $message,
7784
'url' => h($url),
7885
'code' => $code,
7986
'error' => $exception,
87+
'exceptions' => $exceptions,
8088
];
8189

8290
if ($this->error instanceof ValidationException) {

0 commit comments

Comments
 (0)