Supporting "kotlin.running.in.server.mode" to throw exception from the analyzer to be logged by the server
This commit is contained in:
@@ -68,6 +68,18 @@ public class AnalyzerFacade {
|
|||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
catch (Throwable e) {
|
catch (Throwable e) {
|
||||||
|
// This is needed for the Web Demo server to log the exceptions coming from the analyzer instead of showing them in the editor.
|
||||||
|
if (System.getProperty("kotlin.running.in.server.mode", "false").equals("true")) {
|
||||||
|
if (e instanceof RuntimeException) {
|
||||||
|
RuntimeException runtimeException = (RuntimeException) e;
|
||||||
|
throw runtimeException;
|
||||||
|
}
|
||||||
|
if (e instanceof Error) {
|
||||||
|
Error error = (Error) e;
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
BindingTraceContext bindingTraceContext = new BindingTraceContext();
|
BindingTraceContext bindingTraceContext = new BindingTraceContext();
|
||||||
bindingTraceContext.report(Errors.EXCEPTION_WHILE_ANALYZING.on(file, e));
|
bindingTraceContext.report(Errors.EXCEPTION_WHILE_ANALYZING.on(file, e));
|
||||||
|
|||||||
Reference in New Issue
Block a user