Skip to content

Bad JSON returned from the default QuarkusErrorServlet #9463

@lodrantl

Description

@lodrantl

Describe the bug
Using quarkus-undertow and quarkus-resteasy, if an exception is thrown in a JAX-RS endpoint and no ExceptionMapper catches it gets forwarded to QuarkusErrorServlet.

In case of JSON Accept header the stack does not get properly escaped there.

For example, I've encountered a stack ending with (there's a tab before ....):
(SynchronousDispatcher.java:488)\n ... 53 more
which produces a JSON with a string including a tab delimiter.

Here is an example of a more thorough escaping from JSON simple.
https://github.com/fangyidong/json-simple/blob/master/src/main/java/org/json/simple/JSONValue.java#L270

Environment:

  • Quarkus version 1.4.2.Final

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions