Examples for 'base::stop'


Stop Function Execution

Aliases: stop geterrmessage

Keywords: environment programming error

### ** Examples

iter <- 12
try(if(iter > 10) stop("too many iterations"))
Error in try(if (iter > 10) stop("too many iterations")) : 
  too many iterations
tst1 <- function(...) stop("dummy error")
try(tst1(1:10, long, calling, expression))
Error in tst1(1:10, long, calling, expression) : dummy error
tst2 <- function(...) stop("dummy error", call. = FALSE)
try(tst2(1:10, longcalling, expression, but.not.seen.in.Error))
Error : dummy error

[Package base version 4.2.3 Index]