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
Plumber $run method needs documentation #449
Comments
Correct. There should be a
If you run it in the console (not in docker), can you get the error message? If I copy your code and run the API, I can not reproduce it with CRAN or GitHub master branch. This is odd. |
Hey @schloerke, thanks for answering. I've installed plumber from Cran, and ran it like this: Plumber.R
Saved it and ran in R Studio this code:
One thing I saw immediately is that the CRAN version runs swagger UI when running plumber. If I try
Also, when running the query for the error, it does return the message properly:
I'm wondering why that would happen though, is there a possibility that the docker images on dockerhub are outdated? Maybe the latest tag is not the proper one. Maybe it's just missing some configuration that is automatically disabled for the docker images? |
When running in Docker, set |
Do you think that could be related to the error message not coming from docker? Were you able to test it on docker? If you want I can create a project with it working so you can just clone and run to test it. |
Hello again. I managed to figure out why it wasn't printing the message. It was the debug interactive (your tip about swagger helped me to find it). If you're not running plumber with Debug it will not print the message out for you. There's even a test for it: https://github.com/trestletech/plumber/blob/095b5377812d60664e6cc955b1417c4cf46d44c2/tests/testthat/test-default-handlers.R#L28 I've created my own docker image and added the debug option and now I get the error messages. I am not sure where to edit the docs from rplumber.io but maybe it would be useful to mention that there. Thanks again for all the help. |
So, I've just found out that if I add a serializer to the method it will also not return the reason for stopping. So, by adding this to my method I will not get the error back any more.
Just a workaround, if you remove the annotation on the serializer and do this instead,
|
R6 docs added in #530. Closing |
Hi, I'm using the latest plumber docker image and trying to run a very simple script.
This is my dockerfile:
This is my test.R file:
Healthcheck returns a 200 and this:
However, if I call the error one, instead of returning the message as the documentation says it does, it just returns a 500 and this:
Am I missing some config or something? Maybe :latest is not the right tag for the docker image?
Ah, this is the plumber console:
The text was updated successfully, but these errors were encountered: