Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling for layers #27

Closed
ericboucher opened this issue Apr 26, 2020 · 4 comments · Fixed by #87
Closed

Error handling for layers #27

ericboucher opened this issue Apr 26, 2020 · 4 comments · Fixed by #87
Assignees
Labels
enhancement New feature or request frontend sp: 2

Comments

@ericboucher
Copy link
Collaborator

Handle errors when fetching data.

In particular, have the ability to parse time mismatch "Time dimension value '2020-02-10' not valid for this layer".

And server errors (eg. server offline)

@ericboucher ericboucher added enhancement New feature or request frontend labels Apr 26, 2020
@ericboucher ericboucher added this to To do in PRISM Frontend via automation Apr 26, 2020
@ericboucher
Copy link
Collaborator Author

Linked to #7

@ericboucher ericboucher linked a pull request May 16, 2020 that will close this issue
@ericboucher ericboucher removed a link to a pull request May 16, 2020
@bencpeters
Copy link
Collaborator

Redux state now has an errors array in MapState (and an error string for table state and server dates).

We should probably just add a snackbar to display any errors.

This could potentially be implemented using a Redux middleware too.

@Ry-DS
Copy link
Collaborator

Ry-DS commented Jun 17, 2020

@laveesh and I are looking into implementing one of the two react notification APIs

  1. https://teodosii.github.io/react-notifications-component/
  2. https://toasted-notes.netlify.app/

Creating the notification will be pretty easy - just a function call.

We could do this two ways:

  1. Make a redux middleware and check every action that passes through.
    • If we see an action that we know counts as an error (e.g action.type === 'mapState/loadLayerData/rejected') we can read the payload and create the notification there.
  2. Edit the reducers themselves to create a notification.
    • By editing every reducer that counts as storing an error (e.g in serverStateSlice) we can just create the notification there.

Which do you think is better for the long run?

@Ry-DS
Copy link
Collaborator

Ry-DS commented Jun 18, 2020

Update: After some discussion with @laveesh, we've decided to use Material UI's built in Snackbar.

We also will be taking approach 1 to make things more stable in the long run (and as @bencpeters suggested).

Look out for a PR!

PRISM Frontend automation moved this from To do to Done Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend sp: 2
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants