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 | d882b22f2e870fa152f72b85cfd520bc16fcd34a (patch) | |
tree | 6767defd30b93f82893e6c1a5fb5cb11c7358adc /Timeline/ClientApp/src/app/data/common.ts | |
parent | 53214d5aa49fe4a4c85c9a6ebc0941de476d96c5 (diff) | |
download | timeline-d882b22f2e870fa152f72b85cfd520bc16fcd34a.tar.gz timeline-d882b22f2e870fa152f72b85cfd520bc16fcd34a.tar.bz2 timeline-d882b22f2e870fa152f72b85cfd520bc16fcd34a.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;
+ }
+}
|