3 namespace seekat\Exception
;
6 * @param string|\Throwable $message
9 function exception(&$message) : \Throwable
{
10 if ($message instanceof \Throwable
){
11 $exception = $message;
12 $message = $exception->getMessage();
14 $exception = new \
Exception($message);
20 * Canonical error message from a string or Exception
21 * @param string|\Throwable $error
24 function message(&$error) : ?
string {
25 if ($error instanceof \Throwable
) {
26 $message = $error->getMessage();
29 $error = new \
Exception($message);