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

Visualization Error Handling #2815

Closed
2 tasks
radeusgd opened this issue Mar 17, 2021 · 1 comment
Closed
2 tasks

Visualization Error Handling #2815

radeusgd opened this issue Mar 17, 2021 · 1 comment

Comments

@radeusgd
Copy link
Member

General Summary

Currently errors within visualizations are not really handled - usually when one happens the visualization box just stays empty with no feedback to the user.

Two kinds of visualization errors should be handled:

  • if the preprocessing code that is attached to the visualization panics/returns an error/does not compile - currently this can only be checked by inspecting the language server logs,
  • if the JS visualization code fails (for example throws an exception) - currently this can be checked by inspecting dev console logs.

Tasks

  • Display the errors received from the Engine.
  • Display errors when js script throws an exception.

Motivation

Engine specification

#1671 adds new executionContext/visualisationEvaluationFailed notification about visualisation errors.

In general, there are two kinds of visualisation errors.

VisualisationExpressionError, the error reply on executionContext/attachVisualisation or executionContext/modifyVisualisation request. This error is sent when the text visualisation expression is compiled into an Enso function.
(new) executionContext/visualisationEvaluationFailed notification sent during the program execution, when the computed value is applied to the visualisation function.

@mwu-tow
Copy link
Contributor

mwu-tow commented Aug 12, 2021

Not having this done leads to incorrect errors being output to the console.

@mwu-tow mwu-tow transferred this issue from enso-org/ide Oct 28, 2021
akavel added a commit that referenced this issue Dec 21, 2021
- Add parser & handler in IDE for `executionContext/visualisationEvaluationFailed` message from Engine (fixes a developer console error "Failed to decode a notification: unknown variant `executionContext/visualisationEvaluationFailed`"). The contents of the error message will now be properly deserialized and printed to Dev Console with appropriate details.
- Fix a bug in an Enso code snippet used internally by the IDE for error visualizations preprocessing. The snippet was using not currently supported double-quote escaping in double-quote delimited strings. This lack of processing is actually a bug in the Engine, and it was reported to the Engine team, but changing the strings to single-quoted makes the snippet also more readable, so it sounds like a win anyway.
    - A test is also added to the Engine CI, verifying that the snippet compiles & works correctly, to protect against similar regressions in the future.

Related: #2815
@wdanilo wdanilo closed this as completed Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants