January 2018
Intermediate to advanced
336 pages
7h 56m
English
Interceptors might throw an exception due to an error in the implementation. For example, try calling the /hello route with no query parameter. It fails and throws an exception due to the usage of the upper-case function on a nil value of the :name parameter. The exception is thrown by the :enter function of the msg-play interceptor but there is no :error function defined for the interceptor to handle the exception. Such errors must be handled gracefully and errors must be reported to the caller using appropriate HTTP status codes. In this case, if the required parameter :name is not defined, then the route should return a response with a HTTP 400 Bad Request, along with a meaningful message for the caller. ...
Read now
Unlock full access