diff options
Diffstat (limited to 'vendor/thecodingmachine/safe/lib/Exceptions/JsonException.php')
-rw-r--r-- | vendor/thecodingmachine/safe/lib/Exceptions/JsonException.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/thecodingmachine/safe/lib/Exceptions/JsonException.php b/vendor/thecodingmachine/safe/lib/Exceptions/JsonException.php new file mode 100644 index 000000000..4300d29e9 --- /dev/null +++ b/vendor/thecodingmachine/safe/lib/Exceptions/JsonException.php @@ -0,0 +1,12 @@ +<?php + + +namespace Safe\Exceptions; + +class JsonException extends \Exception implements SafeExceptionInterface +{ + public static function createFromPhpError(): self + { + return new self(\json_last_error_msg(), \json_last_error()); + } +} |