| Conditions | 2 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function handle() |
||
| 29 | { |
||
| 30 | $errorData = Formatter::formatExceptionAsDataArray( |
||
| 31 | $this->getInspector(), |
||
| 32 | false |
||
| 33 | ); |
||
| 34 | |||
| 35 | $title = $this->getClassAsTitle($errorData["type"]); |
||
| 36 | |||
| 37 | $response = array( |
||
| 38 | 'error' => [ |
||
| 39 | "type" => $title, |
||
| 40 | "message" => $errorData["message"] |
||
| 41 | ] |
||
| 42 | ); |
||
| 43 | |||
| 44 | $this->setProperHeader($this->getException()); |
||
| 45 | |||
| 46 | echo json_encode($response, defined('JSON_PARTIAL_OUTPUT_ON_ERROR') ? JSON_PARTIAL_OUTPUT_ON_ERROR : 0); |
||
| 47 | |||
| 48 | return Handler::QUIT; |
||
| 49 | } |
||
| 51 |