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;
|
||||
|
||||
import org.jetbrains.kotlin.util.ExceptionUtilKt;
|
||||
|
||||
public interface CompilationErrorHandler {
|
||||
CompilationErrorHandler THROW_EXCEPTION = (exception, fileUrl) -> {
|
||||
if (exception instanceof RuntimeException) {
|
||||
throw (RuntimeException) exception;
|
||||
}
|
||||
throw new IllegalStateException(exception);
|
||||
throw new IllegalStateException(
|
||||
ExceptionUtilKt.getExceptionMessage("Backend", "Exception during code generation", exception, fileUrl),
|
||||
exception
|
||||
);
|
||||
};
|
||||
|
||||
void reportException(Throwable exception, String fileUrl);
|
||||
|
||||
Reference in New Issue
Block a user