Skip to content

Commit 2a6bd07

Browse files
committed
Apply change to State/ApiResource/Error.php as well
1 parent 998b380 commit 2a6bd07

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/State/ApiResource/Error.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ public static function createFromException(\Exception|\Throwable $exception, int
199199
{
200200
$headers = ($exception instanceof SymfonyHttpExceptionInterface || $exception instanceof HttpExceptionInterface) ? $exception->getHeaders() : [];
201201

202+
if ($exception instanceof ProblemExceptionInterface) {
203+
return new self($exception->getTitle(), $exception->getDetail(), $exception->getStatus(), $exception->getTrace(), $exception->getInstance(), $exception->getType(), $headers);
204+
}
205+
202206
return new self('An error occurred', $exception->getMessage(), $status, $exception->getTrace(), type: "/errors/$status", headers: $headers, previous: $exception->getPrevious());
203207
}
204208

0 commit comments

Comments
 (0)