Skip to content

Commit 8f6aea5

Browse files
committed
Make HandleUncaughtException method no longer throw for FATAL result
- Make HandleUncaughtException(ConfigRuntimeException e, Environment env, Reaction r) no longer throw an exception when Reaction is FATAL. Instead, handle it the same as REPORT. - Revert return value change from FATAL to REPORT in GetRaction(...).
1 parent f9e7a07 commit 8f6aea5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/main/java/com/laytonsmith/core/exceptions/ConfigRuntimeException.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,11 @@ public static Reaction GetReaction(ConfigRuntimeException e, Environment env) {
100100
return Reaction.REPORT; // Closure returned nothing -> REPORT.
101101
} catch (FunctionReturnException retException) {
102102
Construct ret = retException.getReturn();
103-
if(ret instanceof CNull || Prefs.ScreamErrors() || !Static.getBoolean(ret, Target.UNKNOWN)) {
104-
return Reaction.REPORT; // Closure returned null or false or scream-errors was set in the config.
103+
if(ret instanceof CNull || Prefs.ScreamErrors()) {
104+
return Reaction.REPORT; // Closure returned null or scream-errors was set in the config.
105105
} else {
106-
return Reaction.IGNORE; // Closure returned true -> IGNORE.
106+
// Closure returned a boolean. TRUE -> IGNORE and FALSE -> FATAL.
107+
return (Static.getBoolean(ret, Target.UNKNOWN) ? Reaction.IGNORE : Reaction.FATAL);
107108
}
108109
} catch (ConfigRuntimeException cre) {
109110

@@ -168,8 +169,6 @@ private static void HandleUncaughtException(ConfigRuntimeException e, Environmen
168169
ConfigRuntimeException.DoReport(e, env);
169170
} else if(r == ConfigRuntimeException.Reaction.FATAL) {
170171
ConfigRuntimeException.DoReport(e, env);
171-
//Well, here goes nothing
172-
throw e;
173172
}
174173
}
175174

0 commit comments

Comments
 (0)