Skip to content

Commit 1180c41

Browse files
committed
Using the handy .internal = TRUE of rlang::abort()
* update snapshot
1 parent 3900d31 commit 1180c41

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

R/parse.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,8 @@ ensure_correct_txt <- function(pd, text) {
158158

159159
if (!lines_and_cols_match(new_text)) {
160160
abort(paste(
161-
"Error in styler:::ensure_correct_txt().",
162-
"Please file an issue on GitHub (https://github.com/r-lib/styler/issues)"
163-
))
161+
"Error in styler:::ensure_correct_txt()."
162+
), .internal = TRUE)
164163
}
165164
names_to_keep <- setdiff(
166165
names(new_text),

R/transform-files.R

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -418,19 +418,16 @@ verify_roundtrip <- function(old_text, new_text, parsable_only = FALSE) {
418418
error = function(e) {
419419
rlang::abort(paste0(
420420
"Styling resulted in code that isn't parsable. This should not ",
421-
"happen. Please file a bug report on GitHub ",
422-
"(https://github.com/r-lib/styler/issues) using a reprex."
423-
))
421+
"happen."
422+
), .internal = TRUE)
424423
}
425424
)
426425
} else if (!expressions_are_identical(old_text, new_text)) {
427426
msg <- paste(
428427
"The expression evaluated before the styling is not the same as the",
429-
"expression after styling. This should not happen. Please file a",
430-
"bug report on GitHub (https://github.com/r-lib/styler/issues)",
431-
"using a reprex."
428+
"expression after styling. This should not happen."
432429
)
433-
abort(msg)
430+
abort(msg, .internal = TRUE)
434431
}
435432
}
436433

tests/testthat/_snaps/roundtrip.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55

66
# corrupt styling does give an error
77

8-
The expression evaluated before the styling is not the same as the expression after styling. This should not happen. Please file a bug report on GitHub (https://github.com/r-lib/styler/issues) using a reprex.
8+
The expression evaluated before the styling is not the same as the expression after styling. This should not happen.
9+
i This is an internal error that was detected in the styler package.
10+
Please report it at <https://github.com/r-lib/styler/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.
911

0 commit comments

Comments
 (0)