-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Report Visualization Errors #1671
Conversation
Changelog:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Just please make sure if the tests in ContextRegistryTest
and VisualisationOperationsTest
are not unnecessarily duplicated - because it seems at first look that some of them are, but I may be missing some nuances.
ctx: RuntimeContext | ||
): PartialFunction[Throwable, Api.ExecutionResult.Diagnostic] = { | ||
case ex: AbstractTruffleException | ||
if Option(ctx.executionService.getLanguage(ex)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not directly relevant to this PR (as this was here before), but I was wondering (and it doesn't seem to be documented) - what is the purpose of this guard? It lets through AbstractTruffleException
s if the language is null or is Enso - so it specifically ignores errors from different languages, unless language is not set at all.
It seems a bit weird to me, because later we look for the stacktrace so it seems maybe we'd want to have only Enso here? So I'm wondering if it wasn't supposed to be exists
instead of forall
, but I cannot judge that without documentation that would clarify the intent behind this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The guard filters only the Enso errors. But currently, getLanguage
can only tell the language by the source file, and return null
when the error originates in built-in nodes. It means that we need forall
to include builtins as well. Builtins cover a significant part of the language, and most of the calls end up there, so we definitely want to support them.
The guard is definitely not obvious, so I'll add a comment there 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The guard filters only the Enso errors. But currently,
getLanguage
can only tell the language by the source file, and returnnull
when the error originates in built-in nodes.
So I understand that technically we can get a node with null
language that is not from Enso, right? But we have no good way to check that? If yes, if we get such input, do we expect that it could crash or is it safe to execute the rest of the code on it? (And if it is safe, why do we ignore other languages then?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be safe to execute the code on any exception. When the code was written, we only had an Enso and a host (Java) languages, and the idea was to provide the right context and show only stuff related to Enso
engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/ProgramExecutionSupport.scala
Outdated
Show resolved
Hide resolved
…job/ProgramExecutionSupport.scala Co-authored-by: Radosław Waśko <radoslaw.wasko@enso.org>
Add `executionContext/visualisationEvaluationFailed` notification
Pull Request Description
close #1557
Replace
VisualisationEvaluationError
reply to a binary channel withexecutionContext/visualisationEvaluationFailed
notification. Evaluation error can't be sent as a reply because it is a part of a program execution, that happens asynchronously. It should be a notification with an appropriate context (similar to an expression update notification)Important Notes
API changes:
executionContext/visualisationEvaluationFailed
Checklist
Please include the following checklist in your PR: