You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reactive Routes: invalid value for a converted @Param results in 500 instead of 400 #57828
A reactive route parameter of a converted type (@Param Integer, Long, Boolean, …) results in 500 Internal Server Error when the request contains a value that cannot be converted, e.g. ?value=abc for an Integer. The generated handler catches the conversion failure and rethrows it as an IllegalArgumentException (ReactiveRoutesProcessor), which ends up in QuarkusErrorHandler as a 500.
Expected behavior
400 Bad Request, since the value comes from the client.
Actual behavior
500 Internal Server Error:
ERROR [io.quarkus.vertx.http.runtime.QuarkusErrorHandler] (vert.x-eventloop-thread-1) HTTP Request to /square?value=abc failed, error id: ...: java.lang.IllegalArgumentException: Error converting parameter #0 of method org.acme.Routes.square()
...
Caused by: java.lang.NumberFormatException: For input string: "abc"
How to Reproduce?
Create a project:
mvn io.quarkus.platform:quarkus-maven-plugin:3.40.1.1:create \
-DprojectGroupId=org.acme -DprojectArtifactId=routes-repro \
-Dextensions=reactive-routes -DnoCode
cd routes-repro
Activity