| Conditions | 4 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | public function render($request, Exception $exception) |
||
| 44 | { |
||
| 45 | if ($exception instanceof ServiceException) |
||
| 46 | { |
||
| 47 | return response()->json([ |
||
| 48 | 'error' => $exception->getUserMessage(), |
||
| 49 | ], 422); |
||
| 50 | } |
||
| 51 | |||
| 52 | if ($exception instanceof BusinessException) |
||
| 53 | { |
||
| 54 | return response()->json([ |
||
| 55 | 'error' => $exception->getUserMessage(), |
||
| 56 | ], 422); |
||
| 57 | } |
||
| 58 | |||
| 59 | if ($exception instanceof EntityNotFoundException) |
||
| 60 | { |
||
| 61 | return response('', 404); |
||
| 62 | } |
||
| 63 | |||
| 64 | return parent::render($request, $exception); |
||
| 65 | } |
||
| 67 |