Description Usage Arguments Details Value Author(s) See Also Examples
Generates an error of class userError
1 |
message |
error msg |
class |
character vector: the classes hyrarchy below class userError. First entry is the most specialized |
call |
call expression. |
Creates an error of subclass of error.
This class can be used in tryCatch
to handle different error sources
error of class c(class,"userError","error")
Thomas Wutzler
twMisc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | res <- tryCatch({
#stop( userError("My error message") )
stop( userError(class="argsError", "My error message") )
}
,argsError=function(e){
cat("Handle my very specialized error of class argsError/userError/error\n");
print(e)
}
,userError=function(e){
cat("Handle my specialized errors of class userError/error\n");
print(e)
}
,error=function(e){
cat("Handle all the other errors\n")
print(e)
}
,finally=function(){
cat("Finally clear up.")
}
) # end of tryCatch
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.