vertx-web
vertx-web copied to clipboard
RouteToEBServiceHandlerImpl should consider ServiceException code
Questions
Should we not expose the response code if we, in a service, throw a ServiceException?
Version
4.0.0
Context
In vertx-web-api-service;
When a web api service throws/fails ServiceException, then the reply handler simply "ignore" the exception, and fails the RoutingContext with a 500 Internal server error and the error message.
IMHO, we should check for the exception type, and if not a ServiceException we could fail with 500.
Do you have a reproducer?
No. But have a look at RouteToEBServiceHandlerImpl.handle() method.
res.cause() could be either a ServiceException or a completely different exception.
@slinkydeveloper any opinion on this one ?
https://github.com/vert-x3/vertx-web/pull/1829#issuecomment-758798885