Skip to content

Instantly share code, notes, and snippets.

@kbroman
Created December 17, 2014 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbroman/7813e9078c9a760aa599 to your computer and use it in GitHub Desktop.
Save kbroman/7813e9078c9a760aa599 to your computer and use it in GitHub Desktop.
options(error = function() {
library(RPushbullet)
pbPost("note", "Error", geterrmessage())
if(!interactive()) stop(geterrmessage())
})
stop("this is an error")
message("Shouldn't get here")
R version 3.1.2 Patched (2014-12-11 r67157) -- "Pumpkin Helmet"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
[Previously saved workspace restored]
> options(error = function() {
+ library(RPushbullet)
+ pbPost("note", "Error", geterrmessage())
+ if(!interactive()) stop(geterrmessage())
+ })
>
> stop("this is an error")
Error: this is an error
Error during wrapup: Error: this is an error
Execution halted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment