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

Docs suggest error msg returned, but it is not. #909

Open
mmuurr opened this issue May 31, 2023 · 2 comments
Open

Docs suggest error msg returned, but it is not. #909

mmuurr opened this issue May 31, 2023 · 2 comments
Labels
answered? Waiting for confirmation that the issue is solved docs Related to documentation only knowledge 🤯 Learn about common {plumber} problems type: question Poses a question, not a problem

Comments

@mmuurr
Copy link

mmuurr commented May 31, 2023

I'm not sure if either (i) the docs are out-of-sync with the current release or (ii) the behavior is a bug.
Plumb a simple API with only this endpoint, using defaults for everything else:

#* @get /simple
function() {
  stop("I'm an error!")
}

Plumbed via:

pr_run(pr("myfile.R"), host = "127.0.0.1", port = 8080)

The returned payload does not include the error msg, despite the docs suggesting it should (in the default config, at least):

curl http://localhost:8080/simple

yields:

{"error":"500 - Internal server error"}

{plumber} v1.2.1

@slodge
Copy link

slodge commented Jun 14, 2023

I'm not familiar with the history here - but I think you need to opt into messages - https://www.rplumber.io/reference/pr_set_debug.html - possibly something to do with plumber not leaking data by default.

It might be that the docs need updating...

@meztez
Copy link
Collaborator

meztez commented Nov 20, 2023

Debugging is enabled by default in interactive mode and you will get the same message as the doc. Otherwise, only the error is returned to the client.

default_debug <- function() {

getDebug = function() {

If you want debugging info in non-interactive mode, you can follow @slodge suggestion above.

@meztez meztez added type: question Poses a question, not a problem docs Related to documentation only answered? Waiting for confirmation that the issue is solved knowledge 🤯 Learn about common {plumber} problems labels Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered? Waiting for confirmation that the issue is solved docs Related to documentation only knowledge 🤯 Learn about common {plumber} problems type: question Poses a question, not a problem
Projects
None yet
Development

No branches or pull requests

3 participants