We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pr_set_error()
pr_mount()
I expect pr_set_error() to be invoked when hitting endpoints defined inside pr_mount():
library(plumber) pr1 <- pr() |> pr_get("/error", function() log("a")) pr() |> pr_mount("/get", pr1) |> pr_set_error(function(req, res, err) { browser() }) |> pr_run()
In this example, the handler function inside pr_set_error() is never invoked when hitting the /get/error endpoint.
/get/error
The text was updated successfully, but these errors were encountered:
This is because the default error handler of pr1 catches the error so that it never bubbles up to the parent pr
If you want the the behaviour you are after you can turn off the error handling in pr1
library(plumber) pr1 <- pr() |> pr_get("/error", function() log("a")) |> pr_set_error(NULL) pr() |> pr_mount("/get", pr1) |> pr_set_error(function(req, res, err) { browser() }) |> pr_run()
Sorry, something went wrong.
No branches or pull requests
I expect
pr_set_error()
to be invoked when hitting endpoints defined insidepr_mount()
:In this example, the handler function inside
pr_set_error()
is never invoked when hitting the/get/error
endpoint.The text was updated successfully, but these errors were encountered: