diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RErrorHandling.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RErrorHandling.java index 6a5b182e76243b8c5d1ea97ee819b20d8cf85b68..ac0af78b884cfab4b846dbdea61cac73915befec 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RErrorHandling.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RErrorHandling.java @@ -388,7 +388,7 @@ public class RErrorHandling { } else { RFunction handler = (RFunction) entry.getDataAt(2); RStringVector errorMsgVec = RDataFactory.createStringVectorFromScalar(fMsg); - RContext.getRRuntimeASTAccess().callback(handler, new Object[]{errorMsgVec, call}); + RContext.getRRuntimeASTAccess().callback(handler, new Object[]{errorMsgVec}); } } else { throw gotoExitingHandler(RNull.instance, call, entry); diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test index 07a17a4a9406b0c87695964980e93db2d8bd726d..3ab87815debd8fab265f490b00b710d2c0efc683 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test @@ -77655,6 +77655,16 @@ Error in tryCatchList(expr, classes, parentenv, handlers) : fred #{ tryCatch(stop("xyz"), error=function(e) { cat("<error>");123L }, finally=function() { cat("<finally>")}) } <error>[1] 123 +##com.oracle.truffle.r.test.library.base.TestConditionHandling.testWithCallingHandlers#Output.IgnoreErrorContext# +#withCallingHandlers(stop('error message'), error=function(e) {}) +Error in withCallingHandlers(stop("error message"), error = function(e) { : + error message + +##com.oracle.truffle.r.test.library.base.TestConditionHandling.testWithCallingHandlers#Output.IgnoreErrorMessage# +#withCallingHandlers(unknownSymbol(), condition = function(e) {}) +Error in withCallingHandlers(unknownSymbol(), condition = function(e) { : + could not find function "unknownSymbol" + ##com.oracle.truffle.r.test.library.base.TestConditionHandling.testWithCallingHandlers# #withCallingHandlers({message("foo");123L},<<<NEWLINE>>> message=function(e) {<<<NEWLINE>>> cat("<msg>")<<<NEWLINE>>> invokeRestart("muffleMessage")<<<NEWLINE>>> }) <msg>[1] 123 diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/base/TestConditionHandling.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/base/TestConditionHandling.java index 8d7b2dcf1abc33ede8b98aa6ddc300275d0c5df2..c2c416bad75f8e020b1eb20d5e8591bfcfaa132b 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/base/TestConditionHandling.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/base/TestConditionHandling.java @@ -63,5 +63,7 @@ public class TestConditionHandling extends TestRBase { assertEval("withCallingHandlers({message(\"foo\");123L},\n message=function(e) {cat(\"<msg>\")})"); assertEval("withCallingHandlers({message(\"foo\");123L},\n message=function(e) {\n cat(\"<msg>\")\n invokeRestart(\"muffleMessage\")\n })"); assertEval("withCallingHandlers({message(\"foo\");packageStartupMessage(\"bar\");123L},\n packageStartupMessage=function(e) {\n cat(\"<msg>\")\n invokeRestart(\"muffleMessage\")\n })"); + assertEval(Output.IgnoreErrorContext, "withCallingHandlers(stop('error message'), error=function(e) {})"); + assertEval(Output.IgnoreErrorMessage, "withCallingHandlers(unknownSymbol(), condition = function(e) {})"); } }