Get rid of unnecessary exceptions in JS translator
Before this commit, an internal error during JS translation resulted in the actual exception wrapped in TranslationRuntimeException wrapped in TranslationInternalException wrapped in RuntimeException being thrown. This change gets rid of the two latter wrappings. Also delete unthrown MainFunctionNotFoundException and related unused constructors in TranslationException
This commit is contained in:
@@ -55,6 +55,7 @@ import org.jetbrains.kotlin.js.facade.MainCallParameters;
|
||||
import org.jetbrains.kotlin.js.facade.TranslationResult;
|
||||
import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStatus;
|
||||
import org.jetbrains.kotlin.psi.KtFile;
|
||||
import org.jetbrains.kotlin.utils.ExceptionUtilsKt;
|
||||
import org.jetbrains.kotlin.utils.PathUtil;
|
||||
|
||||
import java.io.File;
|
||||
@@ -169,8 +170,9 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
|
||||
try {
|
||||
//noinspection unchecked
|
||||
translationResult = translator.translate(sourcesFiles, mainCallParameters, jsAnalysisResult);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw ExceptionUtilsKt.rethrow(e);
|
||||
}
|
||||
|
||||
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled();
|
||||
|
||||
Reference in New Issue
Block a user