#* Example of throwing an error
#* @get /simple
function(){
stop("I'm an error!")
}
#* Generate a friendly error
#* @get /friendly
function(res){
msg <- "Your request did not include a required parameter."
res$status <- 400 # Bad request
list(error=jsonlite::unbox(msg))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.