Skip to content

Commit

Permalink
[9.x] Put the error message at the bottom of the exceptions (#40886)
Browse files Browse the repository at this point in the history
* Put the error message at the bottom of the exceptions.

* Update TestResponse.php

* Update TestResponse.php

* Update TestResponse.php

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
nshiro and taylorotwell authored Feb 11, 2022
1 parent a26c7cc commit 3a98b49
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Illuminate/Testing/TestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ protected function statusMessageWithDetails($expected, $actual)
*/
protected function statusMessageWithException($expected, $actual, $exception)
{
$message = $exception->getMessage();

$exception = (string) $exception;

return <<<EOF
Expand All @@ -232,6 +234,11 @@ protected function statusMessageWithException($expected, $actual, $exception)
The following exception occurred during the request:
$exception
----------------------------------------------------------------------------------
$message
EOF;
}

Expand Down

0 comments on commit 3a98b49

Please sign in to comment.