fix: use decompiler when visualizing optimized expression in condition exceptions
This commit is contained in:
parent
cf7245c915
commit
65096a6ea4
@ -7,6 +7,7 @@ import io.gitlab.jfronny.muscript.core.LocationalException;
|
||||
import io.gitlab.jfronny.muscript.core.PrettyPrintError;
|
||||
import io.gitlab.jfronny.muscript.data.additional.context.Scope;
|
||||
import io.gitlab.jfronny.muscript.runtime.Runtime;
|
||||
import io.gitlab.jfronny.muscript.serialize.Decompiler;
|
||||
import io.gitlab.jfronny.respackopts.gson.ConditionDeserializer;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@ -18,13 +19,13 @@ public record Condition(String source, String sourceFile, BoolExpr expr) {
|
||||
} catch (LocationalException e) {
|
||||
throw new ConditionException(
|
||||
e.asPrintable(),
|
||||
"Your expression was optimized to: " + expr + "\nRemember: You can use '/rpoc dump scope' to view your execution scope",
|
||||
"Your expression was optimized to: " + Decompiler.decompile(expr) + "\nRemember: You can use '/rpoc dump scope' to view your execution scope",
|
||||
e
|
||||
);
|
||||
} catch (RuntimeException e) {
|
||||
throw new ConditionException(
|
||||
PrettyPrintError.builder(new CodeLocation(0, 0, source, sourceFile)).setMessage(e.getMessage()).build(),
|
||||
"Your expression was optimized to: " + expr + "\nRemember: You can use '/rpoc dump scope' to view your execution scope",
|
||||
"Your expression was optimized to: " + Decompiler.decompile(expr) + "\nRemember: You can use '/rpoc dump scope' to view your execution scope",
|
||||
e
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user