问题
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 reported in the logs of my batch system. Is there a way to completely suppress the error and simply proceed with the error handling I provide?
回答1:
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) {})
来源:https://stackoverflow.com/questions/36683031/trycatch-suppress-error-message