We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 712fe08 commit b538187Copy full SHA for b538187
R/riskmetric.R
@@ -53,7 +53,10 @@ assessment <- function(assessment) {
53
#' @examples
54
#' is_risk_error(1)
55
is_risk_error <- function(x) {
56
- if (inherits(x, "pkg_metric")) {
+ x <- tryCatch(x, error = identity)
57
+ if (is(x, "simpleError")) {
58
+ FALSE
59
+ } else if (inherits(x, "pkg_metric")) {
60
inherits(x, "pkg_metric_error") || inherits(x, "error")
61
} else {
62
NA
0 commit comments