summaryrefslogtreecommitdiff
path: root/packages/anastasis-webui/src/hooks
diff options
context:
space:
mode:
authorNullptrderef <nullptrderef@proton.me>2024-04-21 09:51:15 +0200
committerNullptrderef <nullptrderef@proton.me>2024-04-21 09:51:15 +0200
commit8841c30a571f751fc4f9a5a7e7cb9b220618b0c5 (patch)
treebe3c17d788992da61ba9a18dc8ad53fe2163baec /packages/anastasis-webui/src/hooks
parent9b1d1feacd62d259cd56d6ed781d3ed34176db43 (diff)
downloadwallet-core-8841c30a571f751fc4f9a5a7e7cb9b220618b0c5.tar.gz
wallet-core-8841c30a571f751fc4f9a5a7e7cb9b220618b0c5.tar.bz2
wallet-core-8841c30a571f751fc4f9a5a7e7cb9b220618b0c5.zip
use new Error (standard, as error is a class)
Diffstat (limited to 'packages/anastasis-webui/src/hooks')
-rw-r--r--packages/anastasis-webui/src/hooks/use-anastasis-reducer.ts6
1 files changed, 3 insertions, 3 deletions
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<void> {
@@ -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<ReducerState> {
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;
}