Specify MDJsonEncodingFailedException for failure to encode JSON through

MD_STD::json_encode
This commit is contained in:
2021-11-26 03:23:07 +01:00
parent 8f5174e90d
commit 86c8235dae
2 changed files with 21 additions and 2 deletions

View File

@ -242,7 +242,7 @@ final class MD_STD {
$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 @@ final class MD_STD {
$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;