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 36fbd7e
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 @@ -162,6 +162,7 @@ protected function context()
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Symfony\Component\HttpFoundation\Response
* @throws \Exception $e
*/
public function render($request, Exception $e)
{
Expand All @@ -181,6 +182,10 @@ public function render($request, Exception $e)
return $this->convertValidationExceptionToResponse($e, $request);
}

if (! $this->isHttpException($e) && app()->runningUnitTests()) {
throw $e;
}

return $request->expectsJson()
? $this->prepareJsonResponse($request, $e)
: $this->prepareResponse($request, $e);
Expand Down

0 comments on commit 36fbd7e

Please sign in to comment.