You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, let me start off by saying thank you for an awesome flexible package for deploying APIs using R.
I see in the docs that one can set a custom error handler using something like (wherecustom_error_handler is a function that handles errors as they come up, similar to the defaultErrorHandler used by Plumber) :
r <- plumb("plumber_api.R")
r$setErrorHandler(custom_error_handler)
r$run()
This works great and I was able to get my custom error handling working well. However, I didn't see (in the docs or source) a way to use an annotation like one can for creating serializers or filters for defining a custom error handler for an app.
I've forked the repo, and created a working proof of concept for adding this which was based off of how filters and serializers were implemented. I've also tested this locally and publishing an API to RStudio Connect that includes and uses custom error handling (which is the use case I was looking for the errorhandling annotation for).
I'm happy to submit this as a PR if this approach is reasonable (after I add bit more checking for e.g. that only one errorhandler is provided).
The text was updated successfully, but these errors were encountered:
First, let me start off by saying thank you for an awesome flexible package for deploying APIs using R.
I see in the docs that one can set a custom error handler using something like (where
custom_error_handler
is a function that handles errors as they come up, similar to thedefaultErrorHandler
used by Plumber) :This works great and I was able to get my custom error handling working well. However, I didn't see (in the docs or source) a way to use an annotation like one can for creating serializers or filters for defining a custom error handler for an app.
I've forked the repo, and created a working proof of concept for adding this which was based off of how filters and serializers were implemented. I've also tested this locally and publishing an API to RStudio Connect that includes and uses custom error handling (which is the use case I was looking for the errorhandling annotation for).
I'm happy to submit this as a PR if this approach is reasonable (after I add bit more checking for e.g. that only one errorhandler is provided).
The text was updated successfully, but these errors were encountered: