Skip to content

Commit

Permalink
feat(json_parser.dart): slightly improve error message for invalid type
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Dec 6, 2024
1 parent f3107df commit d4a22ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/src/core/definitions/extensions/json_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ extension ParseField on Map<String, dynamic> {
return <String, dynamic>{} as T;
}

throw FormatException("Expected $T, got ${fieldValue.runtimeType}");
throw FormatException(
"Expected $T, got ${fieldValue.runtimeType} for field $name",
);
}

/// Parses a single field with a given [name] as a [Uri].
Expand Down

0 comments on commit d4a22ec

Please sign in to comment.