Specify MDJsonEncodingFailedException for failure to encode JSON through

MD_STD::json_encode
This commit is contained in:
jrenslin committed 2021-11-26 03:23:07 +01:00
1 parent 8f5174e90d
commit 86c8235dae
2 files changed
+21 -2

No files matched your search

+2 -2
View File
@@ -242,7 +242,7 @@ public static function json_encode(array $value, int $options = 0, int $depth =
$output = \json_encode($value, $options, $depth);
if ($output === false) {
throw new Exception("JSON output could not be generated");
throw new MDJsonEncodingFailedException("JSON output could not be generated");
}
return $output;
@@ -263,7 +263,7 @@ public static function json_encode_object(object $value, int $options = 0, int $
$output = \json_encode($value, $options, $depth);
if ($output === false) {
throw new Exception("JSON output could not be generated");
throw new MDJsonEncodingFailedException("JSON output could not be generated");
}
return $output;