Skip to content
New issue

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() doesn't apply to endpoints defined inside pr_mount() #953

Open
gacolitti opened this issue Apr 29, 2024 · 0 comments
Open

Comments

@gacolitti
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant