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

Web server: don't return stack trace in error document #158

Open
bertfrees opened this issue Nov 26, 2020 · 0 comments
Open

Web server: don't return stack trace in error document #158

bertfrees opened this issue Nov 26, 2020 · 0 comments

Comments

@bertfrees
Copy link
Member

For example, when a specific job that does not exist is queried with /jobs/unexisting-job, you get a 404 (this is correct) and a error document that looks something like this:

<error xmlns="http://www.daisy.org/ns/pipeline/data"
       query="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">
    <description>Job not found</description>
    <trace>java.lang.Throwable: Job not found
        at org.daisy.pipeline.webservice.impl.GenericResource.getErrorRepresentation(GenericResource.java:36)
        at org.daisy.pipeline.webservice.impl.JobResource.getResource(JobResource.java:78)
        at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.restlet.resource.ServerResource.doHandle(ServerResource.java:506)
        at org.restlet.resource.ServerResource.get(ServerResource.java:707)
        at org.restlet.resource.ServerResource.doHandle(ServerResource.java:589)
        at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:649)
        at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:348)
        at org.restlet.resource.ServerResource.handle(ServerResource.java:951)
        at org.restlet.resource.Finder.handle(Finder.java:246)
        at org.restlet.routing.Filter.doHandle(Filter.java:159)
        at org.restlet.routing.Filter.handle(Filter.java:206)
        at org.restlet.routing.Router.doHandle(Router.java:431)
        at org.restlet.routing.Router.handle(Router.java:648)
        ...
    </trace>
</error>

The "Job not found" message is helpful, but the stack trace is just implementation detail.

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