Skip to content

Commit cf43adc

Browse files
authored
Facets catch wrapped errors better (#5671)
* replace `tryCatch()` with `try_fetch()` * add news bullet
1 parent 993c5bf commit cf43adc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
* Fixed bug where discrete scales could not map aesthetics only consisting of
55
`NA`s (#5623)
6+
* Facet evaluation is better at dealing with inherited errors
7+
(@teunbrand, #5670).
68

79
# ggplot2 3.5.0
810

R/facet-.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ eval_facet <- function(facet, data, possible_columns = NULL) {
477477
mask <- new_data_mask(env)
478478
mask$.data <- as_data_pronoun(mask)
479479

480-
tryCatch(
480+
try_fetch(
481481
eval_tidy(facet, mask),
482482
ggplot2_missing_facet_var = function(e) NULL
483483
)

0 commit comments

Comments
 (0)