Skip to content

Commit

Permalink
Throw exception for non http exceptions when running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sileence committed Aug 24, 2017
1 parent f8db604 commit f10fc3d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Illuminate/Foundation/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,15 @@ protected function invalidJson($request, ValidationException $exception)
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Symfony\Component\HttpFoundation\Response
* @throws \Exception $e
*/
protected function prepareResponse($request, Exception $e)
{
if (! $this->isHttpException($e) && config('app.debug')) {
if (app()->runningUnitTests()) {
throw $e;
}

return $this->toIlluminateResponse(
$this->convertExceptionToResponse($e), $e
);
Expand Down

0 comments on commit f10fc3d

Please sign in to comment.