remove things that fail to deserialize

This commit is contained in:
Christien Rioux 2025-04-09 15:38:30 -04:00
parent 2344184620
commit f8977147f6
4 changed files with 36 additions and 9 deletions

View file

@ -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');
}
}
}