diff --git a/NEWS b/NEWS index de37f88..ffa4dd5 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,7 @@ # assertr development version +* Assert errors now print the description in the error summary (PR #132) + * Added the ability to check non-numeric classes with `within_bounds()` (fix #89) diff --git a/R/errors.R b/R/errors.R index 38b0d01..068ebb5 100644 --- a/R/errors.R +++ b/R/errors.R @@ -148,6 +148,10 @@ print.assertr_defect <- function(x, ...){ #' #' @export summary.assertr_assert_error <- function(object, ...){ + if (!is.na(object$description)) { + cat(object$description) + cat("\n") + } cat(object$message) cat("\n") numrows <- nrow(object$error_df)