Skip to content

Commit

Permalink
Initial error handling implementation (#431)
Browse files Browse the repository at this point in the history
* Added ClientError class

* Rebase client.request on generics

* Added error state to client's response

* Added Error dialog

* Added error to application state

* Catch errors in the application component

* Activated error dialog

* Added error state/dialog to controllers

* Impelment error handling for chart

* Implement error handling in file store

* Error handling in metadata

* Error handling in table

* Error handling in text

* Fixed metadata resource dialog

* Exposed Error Dialog

* fixed cors for errors

* Removed dialog duplication

* Fixed formatting
  • Loading branch information
roll authored Jun 24, 2024
1 parent c0f4d26 commit 9153200
Show file tree
Hide file tree
Showing 26 changed files with 775 additions and 281 deletions.
199 changes: 90 additions & 109 deletions client/client.ts

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions client/components/Application/Error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import ErrorDialog from '../Parts/Dialogs/Error'
import { useStore } from './store'

export default function Error() {
const updateState = useStore((state) => state.updateState)
const error = useStore((state) => state.error)
if (!error) return null
return (
<ErrorDialog
detail={error.detail}
onClose={() => updateState({ error: undefined })}
/>
)
}
2 changes: 2 additions & 0 deletions client/components/Application/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Columns from '../Parts/Grids/Columns'
import Action from './Action'
import Content from './Content'
import Dialog from './Dialog'
import Error from './Error'
import Header from './Header'
import Browser from './Browser'
import Menu from './Menu'
Expand All @@ -20,6 +21,7 @@ export default function Layout() {
}, [])
return (
<React.Fragment>
<Error />
<Dialog />
<Header />
<Columns layout={[3, 9]}>
Expand Down
Loading

0 comments on commit 9153200

Please sign in to comment.