vert-x3 / vertx-web

HTTP web applications for Vert.x
Apache License 2.0
1.11k stars 531 forks source link

RouteToEBServiceHandlerImpl should consider ServiceException code #1827

Open thced opened 3 years ago

thced commented 3 years ago

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.

vietj commented 3 years ago

@slinkydeveloper any opinion on this one ?

slinkydeveloper commented 3 years ago

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