Skip to content

Instantly share code, notes, and snippets.

@mclasson
Last active August 17, 2017 10:57
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 mclasson/7f39ed5ce3f1b7dfd57eec53156985c5 to your computer and use it in GitHub Desktop.
Save mclasson/7f39ed5ce3f1b7dfd57eec53156985c5 to your computer and use it in GitHub Desktop.
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