If your endpoint already returns JSON, the easiest way is to catch the error and return a JSON object that contains all the error info you need. something like:
@endpoint
function(){
tryCatch(..., error = function(e) {
res$status = 400 # the response object that is always available in plumber functions
return(list(error = e, traceback = ...))
})
}
if your endpoint returns something else than JSON your out of luck (you can only have one serializer by endpoint). I don't think the ErrorHandler stuff works yet (or if it does, its not documented sufficiently)