Skip to content

Commit 7f1eb7d

Browse files
committed
Added a helpful UnrecognizedKeysException.toString()
Fixes #742
1 parent c708628 commit 7f1eb7d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

json_annotation/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 3.1.1-dev
22

3+
- Added a helpful `UnrecognizedKeysException.toString()`.
34
- Fixed doc comments for `JsonSerializable.genericArgumentFactories`.
45

56
## 3.1.0

json_annotation/lib/src/allowed_keys_helpers.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ class UnrecognizedKeysException extends BadKeyException {
6767

6868
UnrecognizedKeysException(this.unrecognizedKeys, Map map, this.allowedKeys)
6969
: super._(map);
70+
71+
@override
72+
String toString() => message;
7073
}
7174

7275
/// Exception thrown if there are missing required keys in a JSON map that was

0 commit comments

Comments
 (0)