| @@ 14-27 (lines=14) @@ | ||
| 11 | * |
|
| 12 | * @param NotFoundHttpException $exception |
|
| 13 | */ |
|
| 14 | public function notFoundHttpException(NotFoundHttpException $exception) |
|
| 15 | { |
|
| 16 | $statuCode = $exception->getStatusCode(); |
|
| 17 | $error = [[ |
|
| 18 | 'status' => $statuCode, |
|
| 19 | 'code' => $this->getCode('not_found_http'), |
|
| 20 | 'source' => ['pointer' => $exception->getFile().':'.$exception->getLine()], |
|
| 21 | 'title' => $this->getNotFoundMessage($exception), |
|
| 22 | 'detail' => $this->getDescription($exception), |
|
| 23 | ]]; |
|
| 24 | ||
| 25 | $this->jsonApiResponse->setStatus($statuCode); |
|
| 26 | $this->jsonApiResponse->setErrors($error); |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * Get message based on file. If file is RouteCollection return specific |
|
| @@ 9-23 (lines=15) @@ | ||
| 6 | ||
| 7 | trait OAuthServerHandler |
|
| 8 | { |
|
| 9 | public function oAuthServerException(OAuthServerException $exception) |
|
| 10 | { |
|
| 11 | $statusCode = $exception->getHttpStatusCode(); |
|
| 12 | ||
| 13 | $error = [[ |
|
| 14 | 'status' => $statusCode, |
|
| 15 | 'code' => $this->getCode('not_found_http'), |
|
| 16 | 'source' => ['pointer' => $exception->getFile().':'.$exception->getLine()], |
|
| 17 | 'title' => $exception->getErrorType(), |
|
| 18 | 'detail' => $exception->getMessage(), |
|
| 19 | ]]; |
|
| 20 | ||
| 21 | $this->jsonApiResponse->setStatus($statusCode); |
|
| 22 | $this->jsonApiResponse->setErrors($error); |
|
| 23 | } |
|
| 24 | } |
|
| 25 | ||