-
Notifications
You must be signed in to change notification settings - Fork 92
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
Return Error or Warning Message #96
Comments
My thinking was that it is better to not return the internal errors via the API, since that might leak unwanted information. They should be logged, however. Are you not seeing this? |
I see them logged on the server, I may just be forcing it to work but I was trying to test out and create an update or rather upsert function and send the parameters via pg_featureserv, which does work fine but if I create an exception in the function it still will return with a 200 OK response. This may be fine as the data array returned will still be empty and I can error out on that. |
Right, I just noticed that myself. That does seem like a design flaw. The error should be indicated in the response somehow, even if it doesn't contain the internal error message. I will have to check and see if there is a standard way to encode an error message in the response document. At least the HTTP response code should be set to indicate an error. Perhaps 500, or else 404? |
It turns out that this is in fact a bug. This particular error was not being passed back up the function chain. This is now fixed in da64e20. I'm not sure the reponse body is appropriate, however - it is HTML, rather than JSON. This needs looking into. The HTTP Status Code is correct however - it is 500. |
@Jnb2387 can this issue be closed? |
Yes sorry. PG_Featureserv just keeps getting better and better! Thanks @dr-jts |
Great to hear. Stay tuned for a release coming soon, with all the new features that have been piling up. And hopefully some support for CQL! |
* add basic metrics * add go.sum (`make build` requires it up to date) * only track metrics for valid layers * add 404 and 400 errors * 404 for layer not found errors * 400 for invalid tile errors (same behavior as OSM) * metrics ignore all 4xx errors * don't try to record metrics if label error occurs
I am able to view the ERROR code from my plpgsql function on the server, but is it possible to return the message from postgres in the response? I am not sure if this was returned before #59 , the response empty data array is useful but even with a raise exception its hard to know the query didnt run successfully.
The text was updated successfully, but these errors were encountered: