Add throwableToString method to Utilities class
This commit is contained in:
parent
dcdbb4f68a
commit
38092a639e
1 changed files with 12 additions and 0 deletions
|
@ -105,4 +105,16 @@ class Utilities
|
|||
|
||||
return $headers;
|
||||
}
|
||||
|
||||
public static function throwableToString(\Throwable $e): string
|
||||
{
|
||||
return sprintf(
|
||||
"%s: %s in %s:%d\nStack trace:\n%s",
|
||||
get_class($e),
|
||||
$e->getMessage(),
|
||||
$e->getFile(),
|
||||
$e->getLine(),
|
||||
$e->getTraceAsString()
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue