Closed pjwigan closed 3 months ago
RoutingContext.json()
returns a future that is completed when the response has been sent successfully, otherwise failed.
Besides, if there is an encoding issue, the method invokes RoutingContext.fail()
. So if you install a handler for the failure (see the docs), you should get the notification too.
Closing, since this doesn't look like a bug
Version
4.5.9
Summary
An HTTP call started giving 500 Routing failures following a change to a referenced class. A bug in that class meant a json.EncodeException is being thrown within RoutingContext json(...). However this exception is not being passed back to the caller. The RoutingContext is not ended, hence the subsequent routing failure.
Failing code
Code that revealed the problem
Extra
The bug in our code was a guard added to an accessor method throwing an exception, thus causing the EncodeException.