From cc0cc154b9506d1961d08cb29fbc29ad815bad69 Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 24 Aug 2020 22:59:45 +0800 Subject: ... --- Timeline/ClientApp/src/app/utilities/rxjs.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'Timeline/ClientApp/src/app/utilities/rxjs.ts') diff --git a/Timeline/ClientApp/src/app/utilities/rxjs.ts b/Timeline/ClientApp/src/app/utilities/rxjs.ts index 1be49164..0730b899 100644 --- a/Timeline/ClientApp/src/app/utilities/rxjs.ts +++ b/Timeline/ClientApp/src/app/utilities/rxjs.ts @@ -1,14 +1,14 @@ -import { OperatorFunction } from 'rxjs'; -import { catchError } from 'rxjs/operators'; - -export function convertError( - oldErrorType: { new (...args: never[]): unknown }, - newErrorType: { new (): NewError } -): OperatorFunction { - return catchError((error) => { - if (error instanceof oldErrorType) { - throw new newErrorType(); - } - throw error; - }); -} +import { OperatorFunction } from "rxjs"; +import { catchError } from "rxjs/operators"; + +export function convertError( + oldErrorType: { new (...args: never[]): unknown }, + newErrorType: { new (): NewError } +): OperatorFunction { + return catchError((error) => { + if (error instanceof oldErrorType) { + throw new newErrorType(); + } + throw error; + }); +} -- cgit v1.2.3