Skip to content

Commit d333a78

Browse files
committed
Do not rethrow errors in cookie service
1 parent f1c2db1 commit d333a78

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/services/cookie/cookie.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ export class CookieService {
7676
try {
7777
return /** @type {T} */ (JSON.parse(raw));
7878
} catch (err) {
79-
const error = new SyntaxError(`badparse: "${key}" => ${err.message}`);
80-
this.$exceptionHandler(error);
81-
throw error;
79+
this.$exceptionHandler(
80+
new SyntaxError(`badparse: "${key}" => ${err.message}`),
81+
);
8282
}
8383
}
8484

@@ -110,7 +110,6 @@ export class CookieService {
110110
buildOptions({ ...this.defaults, ...options });
111111
} catch (e) {
112112
this.$exceptionHandler(e);
113-
throw e;
114113
}
115114
}
116115

@@ -129,9 +128,9 @@ export class CookieService {
129128
const str = JSON.stringify(value);
130129
this.put(key, str, options);
131130
} catch (err) {
132-
const error = new TypeError(`badserialize: "${key}" => ${err.message}`);
133-
this.$exceptionHandler(error);
134-
throw error;
131+
this.$exceptionHandler(
132+
new TypeError(`badserialize: "${key}" => ${err.message}`),
133+
);
135134
}
136135
}
137136

0 commit comments

Comments
 (0)