diff options
author | crupest <crupest@outlook.com> | 2020-08-09 22:04:54 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-08-09 22:04:54 +0800 |
commit | 31f2c870cde09099bccab9560bac50be7db8d4d2 (patch) | |
tree | e1fc9d423bfe1854a25bb6fe36f527b931944a6e /Timeline/ClientApp/src/app/data/common.ts | |
parent | fe0322983dffb0813c48f005cea53802434869b9 (diff) | |
download | timeline-31f2c870cde09099bccab9560bac50be7db8d4d2.tar.gz timeline-31f2c870cde09099bccab9560bac50be7db8d4d2.tar.bz2 timeline-31f2c870cde09099bccab9560bac50be7db8d4d2.zip |
Merge sync status into subscription hub.
Diffstat (limited to 'Timeline/ClientApp/src/app/data/common.ts')
-rw-r--r-- | Timeline/ClientApp/src/app/data/common.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Timeline/ClientApp/src/app/data/common.ts b/Timeline/ClientApp/src/app/data/common.ts index 786279f2..35934a29 100644 --- a/Timeline/ClientApp/src/app/data/common.ts +++ b/Timeline/ClientApp/src/app/data/common.ts @@ -1,5 +1,7 @@ import localforage from 'localforage';
+import { HttpNetworkError } from '../http/common';
+
export const dataStorage = localforage.createInstance({
name: 'data',
description: 'Database for offline data.',
@@ -11,3 +13,9 @@ export class ForbiddenError extends Error { super(message);
}
}
+
+export function throwIfNotNetworkError(e: unknown): void {
+ if (!(e instanceof HttpNetworkError)) {
+ throw e;
+ }
+}
|