2021-02-26 16:16:17 +00:00
|
|
|
<?php
|
|
|
|
namespace Safe\Exceptions;
|
|
|
|
|
2022-07-12 19:26:21 +00:00
|
|
|
class GettextException extends \ErrorException implements SafeExceptionInterface
|
2021-02-26 16:16:17 +00:00
|
|
|
{
|
|
|
|
public static function createFromPhpError(): self
|
|
|
|
{
|
|
|
|
$error = error_get_last();
|
|
|
|
return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1);
|
|
|
|
}
|
|
|
|
}
|