mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-20 21:28:41 -04:00
remove things that fail to deserialize
This commit is contained in:
parent
2344184620
commit
f8977147f6
4 changed files with 36 additions and 9 deletions
|
@ -40,6 +40,13 @@ sealed class LocalAccount with _$LocalAccount {
|
|||
required String name,
|
||||
}) = _LocalAccount;
|
||||
|
||||
factory LocalAccount.fromJson(dynamic json) =>
|
||||
_$LocalAccountFromJson(json as Map<String, dynamic>);
|
||||
factory LocalAccount.fromJson(dynamic json) {
|
||||
try {
|
||||
return _$LocalAccountFromJson(json as Map<String, dynamic>);
|
||||
// Need to catch any errors here too
|
||||
// ignore: avoid_catches_without_on_clauses
|
||||
} catch (e, st) {
|
||||
throw Exception('invalid local account: $e\n$st');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue