| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | 1 | public function __invoke(\Exception $e, $code) |
|
| 17 | { |
||
| 18 | 1 | $error = array("code" => $e->getCode(), "message" => $e->getMessage()); |
|
| 19 | 1 | if ($this->app["debug"]) { |
|
| 20 | 1 | $error["trace"] = $e->getTraceAsString(); |
|
| 21 | } |
||
| 22 | |||
| 23 | 1 | $response = $this->app->json($error); |
|
| 24 | |||
| 25 | 1 | return DescribedBySchemaHandler::apply('error', $this->app, $response ); |
|
| 26 | } |
||
| 27 | } |
||
| 28 |