generate static method
Implementation
static JsonSerializationException generate(String? message, [Type? toType]) {
return JsonSerializationException(message ??
ErrorMessages.format(
ErrorMessages.jsonSerializationError, [toType.toString()]));
}