File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -148,18 +148,15 @@ extract_dots_names_safely <- function(...) {
148148 )
149149}
150150
151- # See https://adv-r.hadley.nz/conditions.html#signalling. Code taken from that
152- # book (and I think that's possible since the code is released with MIT
153- # license). The main benefit of this approach is that I can test the class of
154- # the error instead of the message.
151+ # See https://adv-r.hadley.nz/conditions.html#signalling and ?condition. The
152+ # main benefit of this approach is that I can test the class of the error
153+ # instead of the message.
155154oe_stop <- function (.subclass , message , call = NULL , ... ) {
156- err <- structure(
157- list (
158- message = message ,
159- call = call ,
160- ...
161- ),
162- class = c(.subclass , " error" , " condition" )
155+ err <- errorCondition(
156+ message = message ,
157+ ... ,
158+ class = .subclass ,
159+ call = call
163160 )
164161 stop(err )
165162}
You can’t perform that action at this time.
0 commit comments