Skip to content

Commit 7f3dfa6

Browse files
Tweak error message
1 parent f74f4d9 commit 7f3dfa6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Util/ThrowableToStringMapper.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use PHPUnit\Framework\ExpectationFailedException;
1414
use PHPUnit\Framework\PhptAssertionFailedError;
1515
use PHPUnit\Framework\SelfDescribing;
16+
use PHPUnit\Runner\ErrorException;
1617
use Throwable;
1718

1819
/**
@@ -22,6 +23,10 @@ final class ThrowableToStringMapper
2223
{
2324
public static function map(Throwable $t): string
2425
{
26+
if ($t instanceof ErrorException) {
27+
return $t->getMessage();
28+
}
29+
2530
if ($t instanceof SelfDescribing) {
2631
$buffer = $t->toString();
2732

0 commit comments

Comments
 (0)