@@ -21,10 +21,13 @@ class JsonCacheTry implements JsonCache {
21
21
Future <void > clear () async {
22
22
try {
23
23
await _wrapped.clear ();
24
- } on Exception catch (ex) {
25
- throw JsonCacheException (
26
- extra: 'Error clearing cached data.' ,
27
- exception: ex,
24
+ } on Exception catch (ex, st) {
25
+ Error .throwWithStackTrace (
26
+ JsonCacheException (
27
+ extra: 'Error clearing cached data.' ,
28
+ exception: ex,
29
+ ),
30
+ st,
28
31
);
29
32
}
30
33
}
@@ -36,10 +39,13 @@ class JsonCacheTry implements JsonCache {
36
39
Future <void > refresh (String key, Map <String , dynamic > value) async {
37
40
try {
38
41
await _wrapped.refresh (key, value);
39
- } on Exception catch (ex) {
40
- throw JsonCacheException (
41
- extra: "Error refreshing cached data at index '$key '." ,
42
- exception: ex,
42
+ } on Exception catch (ex, st) {
43
+ Error .throwWithStackTrace (
44
+ JsonCacheException (
45
+ extra: "Error refreshing cached data at index '$key '." ,
46
+ exception: ex,
47
+ ),
48
+ st,
43
49
);
44
50
}
45
51
}
@@ -51,10 +57,13 @@ class JsonCacheTry implements JsonCache {
51
57
Future <void > remove (String key) async {
52
58
try {
53
59
await _wrapped.remove (key);
54
- } on Exception catch (ex) {
55
- throw JsonCacheException (
56
- extra: "Error removing cached data at index '$key '." ,
57
- exception: ex,
60
+ } on Exception catch (ex, st) {
61
+ Error .throwWithStackTrace (
62
+ JsonCacheException (
63
+ extra: "Error removing cached data at index '$key '." ,
64
+ exception: ex,
65
+ ),
66
+ st,
58
67
);
59
68
}
60
69
}
@@ -66,10 +75,13 @@ class JsonCacheTry implements JsonCache {
66
75
Future <Map <String , dynamic >?> value (String key) async {
67
76
try {
68
77
return await _wrapped.value (key);
69
- } on Exception catch (ex) {
70
- throw JsonCacheException (
71
- extra: "Error retrieving cached data at index '$key '." ,
72
- exception: ex,
78
+ } on Exception catch (ex, st) {
79
+ Error .throwWithStackTrace (
80
+ JsonCacheException (
81
+ extra: "Error retrieving cached data at index '$key '." ,
82
+ exception: ex,
83
+ ),
84
+ st,
73
85
);
74
86
}
75
87
}
@@ -81,10 +93,13 @@ class JsonCacheTry implements JsonCache {
81
93
Future <bool > contains (String key) async {
82
94
try {
83
95
return await _wrapped.contains (key);
84
- } on Exception catch (ex) {
85
- throw JsonCacheException (
86
- extra: "Error checking for cached data at index '$key '." ,
87
- exception: ex,
96
+ } on Exception catch (ex, st) {
97
+ Error .throwWithStackTrace (
98
+ JsonCacheException (
99
+ extra: "Error checking for cached data at index '$key '." ,
100
+ exception: ex,
101
+ ),
102
+ st,
88
103
);
89
104
}
90
105
}
0 commit comments