Skip to content

Commit 96acdac

Browse files
committed
[GR-27622] Still translate TruffleException for compatibility with languages which did not migrate yet.
PullRequest: truffleruby/2200
2 parents 9263717 + 82df77d commit 96acdac

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

spec/truffle/interop/time_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved. This
1+
# Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved. This
22
# code is released under a tri EPL/GPL/LGPL license. You can use it,
33
# redistribute it and/or modify it under the terms of the:
44
#

src/main/java/org/truffleruby/language/methods/TranslateExceptionNode.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ protected RuntimeException translate(Throwable throwable, UnsupportedOperationBe
111111
throw exception;
112112
} catch (Throwable exception) {
113113
errorProfile.enter();
114-
if (exception instanceof AbstractTruffleException) {
114+
if (exception instanceof com.oracle.truffle.api.TruffleException) {
115115
// A foreign exception
116116
return new RaiseException(
117117
context,
118-
translateForeignException(context, language, (AbstractTruffleException) exception));
118+
translateForeignException(context, language, exception));
119119
} else {
120120
// An internal exception
121121
CompilerDirectives.transferToInterpreter(/* internal exceptions are fatal */);
@@ -241,8 +241,7 @@ private RubyException translateUnsupportedSpecialization(
241241
}
242242

243243
@TruffleBoundary
244-
private RubyException translateForeignException(RubyContext context, RubyLanguage language,
245-
AbstractTruffleException exception) {
244+
private RubyException translateForeignException(RubyContext context, RubyLanguage language, Throwable exception) {
246245
logJavaException(context, this, exception);
247246

248247
// NOTE (eregon, 2 Feb. 2018): This could maybe be modeled as translating each exception to

0 commit comments

Comments
 (0)