From 8841c30a571f751fc4f9a5a7e7cb9b220618b0c5 Mon Sep 17 00:00:00 2001 From: Nullptrderef Date: Sun, 21 Apr 2024 09:51:15 +0200 Subject: use new Error (standard, as error is a class) --- packages/anastasis-webui/src/hooks/use-anastasis-reducer.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/anastasis-webui/src/hooks') diff --git a/packages/anastasis-webui/src/hooks/use-anastasis-reducer.ts b/packages/anastasis-webui/src/hooks/use-anastasis-reducer.ts index fc8c4cf6c..fcc380775 100644 --- a/packages/anastasis-webui/src/hooks/use-anastasis-reducer.ts +++ b/packages/anastasis-webui/src/hooks/use-anastasis-reducer.ts @@ -303,7 +303,7 @@ export function useAnastasisReducer(): AnastasisReducerApi { }, }); } catch (e) { - throw Error("could not restore the state"); + throw new Error("could not restore the state"); } }, async discoverStart(): Promise { @@ -399,7 +399,7 @@ export function useAnastasisReducer(): AnastasisReducerApi { } class ReducerTxImpl implements ReducerTransactionHandle { - constructor(public transactionState: ReducerState) { } + constructor(public transactionState: ReducerState) {} async transition(action: string, args: any): Promise { let s: ReducerState; if (remoteReducer) { @@ -410,7 +410,7 @@ class ReducerTxImpl implements ReducerTransactionHandle { this.transactionState = s; // Abort transaction as soon as we transition into an error state. if (this.transactionState.reducer_type === "error") { - throw Error("transition resulted in error"); + throw new Error("transition resulted in error"); } return this.transactionState; } -- cgit v1.2.3