diff --git a/json_serializable/lib/src/helper_core.dart b/json_serializable/lib/src/helper_core.dart index 0a054f828..6877ee802 100644 --- a/json_serializable/lib/src/helper_core.dart +++ b/json_serializable/lib/src/helper_core.dart @@ -75,7 +75,11 @@ $converterOrKeyInstructions * Set `JsonSerializable.genericArgumentFactories` to `true` https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonSerializable/genericArgumentFactories.html'''; } else if (field.type != error.type) { - message = '$message because of type `${typeToCode(error.type)}`'; + try { + message = '$message because of type `${typeToCode(error.type)}`'; + } on UnimplementedError catch (ex) { + message = '$message because type is Unimplemented ($ex)'; + } } else { final element = error.type.element?.name; todo = '''