mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 10:42:05 +03:00
More info when we fail to log AssertError (#11113)
Motivation: ``` Caused by: java.lang.AssertionError: No polyglot context is entered. A language or context reference must not be used if there is no polyglot context entered. at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotFastThreadLocals.assertValidGet(PolyglotFastThreadLocals.java:481) at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotFastThreadLocals$ContextReferenceImpl.get(PolyglotFastThreadLocals.java:513) at org.enso.runtime/org.enso.interpreter.runtime.EnsoContext.get(EnsoContext.java:246) at org.enso.runtime/org.enso.interpreter.runtime.error.PanicException.computeMessage(PanicException.java:90) ```
This commit is contained in:
parent
567910ae14
commit
862100c7c0
@ -87,9 +87,15 @@ public final class PanicException extends AbstractTruffleException implements En
|
|||||||
info = library.getExceptionMessage(this);
|
info = library.getExceptionMessage(this);
|
||||||
msg = library.asString(info);
|
msg = library.asString(info);
|
||||||
} catch (AssertionError | UnsupportedMessageException e) {
|
} catch (AssertionError | UnsupportedMessageException e) {
|
||||||
var ctx = EnsoContext.get(null);
|
try {
|
||||||
ctx.getLogger().log(Level.WARNING, "Cannot convert " + info + " to string", e);
|
var ctx = EnsoContext.get(null);
|
||||||
msg = TypeToDisplayTextNode.getUncached().execute(payload);
|
ctx.getLogger().log(Level.WARNING, "Cannot convert " + info + " to string", e);
|
||||||
|
msg = TypeToDisplayTextNode.getUncached().execute(payload);
|
||||||
|
} catch (AssertionError assertionError) {
|
||||||
|
throw new AssertionError(
|
||||||
|
"Failed to log failed conversion of " + info + " to string and payload " + payload,
|
||||||
|
assertionError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cacheMessage = msg;
|
cacheMessage = msg;
|
||||||
return msg;
|
return msg;
|
||||||
|
Loading…
Reference in New Issue
Block a user