zio-http
zio-http copied to clipboard
Custom Descriptive Error Message When Trying to Serve Routes with Unhandled Errors
When trying to serve an unhandled route, it is a good idea to create a custom error message using implicit resolution. This message should provide descriptive guidance to the user, explain why the route is not going to be served, and ask the user to handle all errors.
The current error message is like below:
overloaded method serves with alternatives:
[R](route: zio.http.Route[R,zio.http.Response], routes: zio.http.Route[R,zio.http.Response]*)(implicit trace: zio.Trace, tag: zio.EnvironmentTag[R]): zio.URIO[R with zio.http.Server,Nothing] <and>
[R](routes: zio.http.Routes[R,zio.http.Response])(implicit trace: zio.Trace, tag: zio.EnvironmentTag[R]): zio.URIO[R with zio.http.Server,Nothing]
cannot be applied to (zio.http.Route[example.UserProfileService,example.UserProfileError])
The error channel will be gone with 4.x Not sure if we still need this for 3.x I will keep this for 3.8 but likely will discard this.