diff --git a/src/Response/JSON.php b/src/Response/JSON.php index 121400e..ee9ad18 100755 --- a/src/Response/JSON.php +++ b/src/Response/JSON.php @@ -29,8 +29,11 @@ public function parse($data, array $headers) $headers['Status'] === 422 || $headers['Status'] === 400 )) { - print_r($headers); - exit; + throw new Exception([ + 'Message' => $errors, + 'Response' => $data, + 'Headers' => $headers + ]); } if ($headers['Status'] === 201 || $headers['Status'] === 200) { switch ($headers['Method']) {