tryCatch suppress error message

前端 未结 1 1464
难免孤独
难免孤独 2020-12-21 05:11

I am using tryCatch to catch any errors that occur. However, even though I catch them and return the appropriate error value, it looks like the error is still r

相关标签:
1条回答
  • 2020-12-21 05:20

    Make sure you're neither (1) returning an error, nor (2) printing to stderr in your error handling code. Note one gotcha here is message sends its output to stderr.

    A minimal way to fulfills both conditions is tryCatch(expr, error = function(e) {})

    0 讨论(0)
提交回复
热议问题