Improve message of exception thrown from codegen
Don't lose information about which file caused crash.
This commit is contained in:
@@ -16,12 +16,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.codegen;
|
package org.jetbrains.kotlin.codegen;
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.util.ExceptionUtilKt;
|
||||||
|
|
||||||
public interface CompilationErrorHandler {
|
public interface CompilationErrorHandler {
|
||||||
CompilationErrorHandler THROW_EXCEPTION = (exception, fileUrl) -> {
|
CompilationErrorHandler THROW_EXCEPTION = (exception, fileUrl) -> {
|
||||||
if (exception instanceof RuntimeException) {
|
throw new IllegalStateException(
|
||||||
throw (RuntimeException) exception;
|
ExceptionUtilKt.getExceptionMessage("Backend", "Exception during code generation", exception, fileUrl),
|
||||||
}
|
exception
|
||||||
throw new IllegalStateException(exception);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
void reportException(Throwable exception, String fileUrl);
|
void reportException(Throwable exception, String fileUrl);
|
||||||
|
|||||||
Reference in New Issue
Block a user