diff options
| author | Mica White <botahamec@outlook.com> | 2026-01-24 13:14:55 -0500 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2026-01-24 13:14:55 -0500 |
| commit | 328abfd5d31aa73a732eef6885ac0e26819c7d17 (patch) | |
| tree | 96642f65de0a08250d1abe532319a21ceb39806d /lib/jotai.dart | |
| parent | 227bce2edeb4fa20eb8a9eba36063f7e2e30bb9f (diff) | |
Diffstat (limited to 'lib/jotai.dart')
| -rw-r--r-- | lib/jotai.dart | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/jotai.dart b/lib/jotai.dart index 5524e6a..dc1b165 100644 --- a/lib/jotai.dart +++ b/lib/jotai.dart @@ -41,7 +41,15 @@ Future<T> fromString<T>( .then( // Going through all of these sounds like it's slower than necessary, // but it's very simple, and most of the options lists are very small. - (value) => options.firstWhere((option) => value == toString(option)), + (value) { + try { + return options.firstWhere((option) => value == toString(option)); + } catch (error, stack) { + logObservable.value = logObservable.value + ..add('While loading $key:\n$error\n$stack'); + rethrow; + } + }, ); } @@ -82,6 +90,8 @@ final locationAccuracyObservable = observablePreference( LocationAccuracy.values, ); +final logObservable = Observable(<String>[]); + class Observable<T> { T _value; int _nextId = 0; |
