Skip to content

Commit

Permalink
better error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbarbone committed Dec 6, 2024
1 parent ac596b1 commit ba56c7a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: Rprofile
Title: Functions to be loaded with Rprofile
Version: 0.0.0.9008
Version: 0.0.0.9009
Authors@R:
person(given = "Jordan Mark",
family = "Barbone",
Expand Down
4 changes: 2 additions & 2 deletions R/check-cran-status.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

if (is.null(email)) {
email <- .try(get_description_emails())
if (inherits(email, "rprofile_error")) {
if (is_rprofile_error(email)) {
return(invisible())
}
}
Expand All @@ -27,7 +27,7 @@
cache = tempfile("dang_check_cran_status__", fileext = ".rds"),
cache.life = 3600
))))
if (!inherits(res, "error")) {
if (!is_rprofile_error(res)) {
show_table()
success <- TRUE
} else {
Expand Down
2 changes: 1 addition & 1 deletion R/todos.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ do_todos <- function(
if (
!is.null(todo) &&
!.quiet &&
!inherits(todo, "error")
!is_rprofile_error(todo)
) {
print(todo)
}
Expand Down
4 changes: 4 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ yes_no <- function(..., na = NULL) {

NA
}

is_rprofile_error <- function(x) {
inherits(x, "rprofile_error")
}

0 comments on commit ba56c7a

Please sign in to comment.