Skip to content

Commit

Permalink
feat(web): print global errors to console
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-aksamentov committed May 10, 2022
1 parent a4392ec commit 0b085bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ export function MainInputFormSequenceFilePicker() {
.catch((error) => {
setGlobalStatus(AlgorithmGlobalStatus.failed)
set(globalErrorAtom, sanitizeError(error))
console.error(error)
})
},
[
Expand Down
9 changes: 9 additions & 0 deletions packages_rs/nextclade-web/src/state/error.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ import { atom, selector } from 'recoil'
export const globalErrorAtom = atom<Error | undefined>({
key: 'globalError',
default: undefined,
effects: [
({ onSet }) => {
onSet((error, _1, isReset) => {
if (error && !isReset) {
console.error(error)
}
})
},
],
})

export const qrySeqErrorAtom = atom<string | undefined>({
Expand Down

0 comments on commit 0b085bc

Please sign in to comment.