@@ -120,21 +120,19 @@ section_strip <- function(path) {
120
120
# Errors ------------------------------------------------------------------
121
121
122
122
# Make error messages closer to base R
123
- registerS3method(" wrap" , " error" , envir = asNamespace(" knitr" ),
124
- function (x , options ) {
125
- msg <- conditionMessage(x )
126
-
127
- call <- conditionCall(x )
128
- if (is.null(call )) {
129
- msg <- paste0(" Error: " , msg )
130
- } else {
131
- msg <- paste0(" Error in " , deparse(call )[[1 ]], " : " , msg )
132
- }
123
+ sew.error <- function (x , options ) {
124
+ msg <- conditionMessage(x )
133
125
134
- msg <- error_wrap(msg )
135
- knitr ::: msg_wrap(msg , " error" , options )
126
+ call <- conditionCall(x )
127
+ if (is.null(call )) {
128
+ msg <- paste0(" Error: " , msg )
129
+ } else {
130
+ msg <- paste0(" Error in " , deparse(call )[[1 ]], " : " , msg )
136
131
}
137
- )
132
+
133
+ msg <- error_wrap(msg )
134
+ knitr ::: msg_wrap(msg , " error" , options )
135
+ }
138
136
139
137
error_wrap <- function (x , width = getOption(" width" )) {
140
138
lines <- strsplit(x , " \n " , fixed = TRUE )[[1 ]]
0 commit comments