vertx-web icon indicating copy to clipboard operation
vertx-web copied to clipboard

RouteToEBServiceHandlerImpl should consider ServiceException code

Open thced opened this issue 4 years ago • 2 comments

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.

thced avatar Dec 25 '20 22:12 thced

@slinkydeveloper any opinion on this one ?

vietj avatar Jun 03 '21 09:06 vietj

https://github.com/vert-x3/vertx-web/pull/1829#issuecomment-758798885

slinkydeveloper avatar Jun 03 '21 10:06 slinkydeveloper