From d882b22f2e870fa152f72b85cfd520bc16fcd34a Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 9 Aug 2020 22:04:54 +0800 Subject: Merge sync status into subscription hub. --- Timeline/ClientApp/src/app/data/common.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Timeline/ClientApp/src/app/data/common.ts') 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; + } +} -- cgit v1.2.3