Skip to content

Instantly share code, notes, and snippets.

@mclasson

mclasson/errorhandler.R

Last active Aug 17, 2017
Embed
What would you like to do?
library("httr")
httr::set_config(config(http_version = 2)) # set the HTTP version to 1.1 (none, 1.0, 1.1, 2)
sendMail <- function(e){
body <- list(secret = 'sfsdf£$4500dfdd__$$', body=e["message"]) # create a list that will be serialized to JSON
result <- POST(url = "https://prod-10.westeurope.logic.azure.com/workflows/8934jadajada999"
, body = body , encode = "json", handle = NULL)
}
myProcess <- function(){
stop("error")
}
tryCatch(myProcess(), error = sendMail)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.