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

Add error boundary to catch errors in visualizations #4518

Merged
merged 4 commits into from
Jan 6, 2020

Conversation

kravets-levko
Copy link
Collaborator

What type of PR is this? (check all applicable)

  • Feature
  • Bug Fix
  • Other

Description

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

image
image

message="Something went wrong."
description={
<Typography.Text style={{ display: "block" }} ellipsis>
{error.message}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's avoid showing users our dirty laundry and only log it (with debug). In the future it makes sense to send this into Sentry.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Collaborator Author

@kravets-levko kravets-levko Jan 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arikfr Maybe, we could show some message instead - like "Please check visualization options" / "Read docs" (and link to knowledge base) / "Your PC is tired, turn it off" / etc?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would go with either one of:

  1. Error while rendering visualization. Please check visualization options and/or dataset.
  2. Error while rendering visualization.

I'm not sure about suggesting checking the option as usually an error boundary will be triggered due to a bug, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, mostly that will be bugs. But I think there are situations when checking options may help - for example, when visualization expects some column to be, say, numeric, but it's date/time. Of course there should be sanity check in the visualization's code, but in this case user can just use another column or update query. Anyway, we could leave just a "Something went wrong" message

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Error while rendering visualization." is probably a bit better than the generic "something went wrong" as it gives a direction to what went wrong :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 7c5024b

image

@kravets-levko kravets-levko marked this pull request as ready for review January 2, 2020 12:21
@kravets-levko kravets-levko force-pushed the handle-errors-in-visualizations branch from bc28c96 to 7c5024b Compare January 2, 2020 12:41
@kravets-levko kravets-levko mentioned this pull request Jan 2, 2020
27 tasks
@arikfr arikfr merged commit fc9e8fe into master Jan 6, 2020
@arikfr arikfr deleted the handle-errors-in-visualizations branch January 6, 2020 08:22
@arikfr
Copy link
Member

arikfr commented Jan 6, 2020

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants