Skip to content

Commit cf76578

Browse files
committed
Let exceptions bubble up while loading the core library
* It leads to much clearer errors rather than some NoMethodError from trying to print the backtrace early. * Also avoids printing the backtrace multiple times.
1 parent efcfd98 commit cf76578

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/main/java/org/truffleruby/core/CoreLibrary.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.util.concurrent.ConcurrentMap;
2424

2525
import com.oracle.truffle.api.RootCallTarget;
26-
import com.oracle.truffle.api.exception.AbstractTruffleException;
2726
import org.graalvm.shadowed.org.jcodings.transcode.EConvFlags;
2827
import org.truffleruby.RubyContext;
2928
import org.truffleruby.RubyLanguage;
@@ -776,10 +775,9 @@ public void loadRubyCoreLibraryAndPostBoot() {
776775
}
777776
} catch (IOException e) {
778777
throw CompilerDirectives.shouldNotReachHere(e);
779-
} catch (AbstractTruffleException e) {
780-
context.getDefaultBacktraceFormatter()
781-
.printRubyExceptionOnEnvStderr("Exception while loading core library:\n", e);
782-
throw CompilerDirectives.shouldNotReachHere("couldn't load the core library", e);
778+
} catch (Throwable e) {
779+
System.err.println("\nException while loading core library:");
780+
throw e;
783781
}
784782
}
785783

0 commit comments

Comments
 (0)