-
Notifications
You must be signed in to change notification settings - Fork 326
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
PanicSentinel value isn't propagated via Vector & co. #7245
Comments
When I have from Standard.Base import all
main = [1, 2, 3, Decimal.nan ] I can run it and see reasonable error: sbt:enso> runEngineDistribution --run t.enso
Execution finished with an error: Method `nan` of type Decimal.type could not be found.
at <enso> t.main(t.enso:3:18-28) e.g. from a CLI perspective things are looking fine. |
The IDE converts the execution error cause by
This tracing isn't going to happen in the CLI - only IdExecutionInstrument does the conversion. However |
What is the desired behavior? Shall we treat with following few lines change: diff --git engine/runtime-instrument-id-execution/src/main/java/org/enso/interpreter/instrument/IdExecutionInstrument.java engine/runtime-instrument-id-execution/src/main/java/org/enso/interpreter/instrument/IdExecutionInstrument.java
index c868592d51..a710420955 100644
--- engine/runtime-instrument-id-execution/src/main/java/org/enso/interpreter/instrument/IdExecutionInstrument.java
+++ engine/runtime-instrument-id-execution/src/main/java/org/enso/interpreter/instrument/IdExecutionInstrument.java
@@ -244,7 +248,10 @@ public class IdExecutionInstrument extends TruffleInstrument implements IdExecut
if (exception instanceof TailCallException) {
onTailCallReturn(exception, Function.ArgumentsHelper.getState(frame.getArguments()));
} else if (exception instanceof PanicException panicException) {
- onReturnValue(frame, new PanicSentinel(panicException, context.getInstrumentedNode()));
+ var ctx = EnsoContext.get(context.getInstrumentedNode());
+ var sentinel = new PanicSentinel(panicException, context.getInstrumentedNode());
+ var warning = Warning.create(ctx, panicException.getMessage(), context.getInstrumentedNode());
+ onReturnValue(frame, WithWarnings.appendTo(ctx, sentinel, warning));
} else if (exception instanceof AbstractTruffleException) {
onReturnValue(frame, exception);
} Would you consider that a fix, @jdunkerley? Probably not as I now can see that I changed the red border to orange one. If that is a problem (which I expect), then we need something slightly better:
CCing @4e6 |
The #7385 pull request shows a conservative approach that just turns
e.g. we are not getting |
Jaroslav Tulach reports a new STANDUP for yesterday (2023-07-25): Progress: Jul 25 - 9 h
Next Day: Bugfixes & cleanup
|
Jaroslav Tulach reports a new STANDUP for yesterday (2023-07-27): Progress: -
Next Day: Interop with Python |
Fixes #7245.  The above picture shows that the _vector problem_ reported by #7245 is fixed. # Important Notes The fix modifies `SequenceLiteralNode` to recognize `PanicSentinel` and `throw` it as common in other places (like invoke function node, etc.).
Jaroslav Tulach reports a new STANDUP for yesterday (2023-07-28): Progress: - merged Python interop, phase I: #7396
Next Day: BigInteger & Interop with Python |
If the user enters some invalid code within a Vector, this results in only an "Execution failed" and no way to find the error.
The text was updated successfully, but these errors were encountered: