AbstractExceptionMapper for usage from Java
A class to register com.twitter.finatra.http.exceptions.ExceptionMappers and handle exceptions.
An ExceptionMapper converts a T
-typed throwable to an HTTP response.
An ExceptionMapper converts a T
-typed throwable to an HTTP response.
Java users should use the AbstractExceptionMapper.
Represents a collection of com.twitter.finatra.http.exceptions.ExceptionMappers which is a Traversable[Manifest[ExceptionMapper[_\]\]\].
HttpException which will be rendered as an HTTP response.
A class to register com.twitter.finatra.http.exceptions.ExceptionMappers and handle exceptions.
Given an exception, the ExceptionManager will find an com.twitter.finatra.http.exceptions.ExceptionMapper to handle that particular class of exceptions. If the mapper for that exception isn't registered, the ExceptionManager will try the exception's parent class, and so on, until it reaches the Throwable class. The framework registers a "root" exception mapper over Throwable which will eventually be invoked. Users are free to register their own ExceptionMapper[Throwable] which overrides the "root" exception mapper.
com.twitter.finatra.http.internal.exceptions.ThrowableExceptionMapper Note: When searching for the parent exception mapper, it would be nice to traverse the entire class linearization so it works for traits/mixins too [1]. Unfortunately, implementing this would require a lot more reflection and it might not be threadsafe [2]. Doing it in Scala 2.11 might be easier and safer. [1] https://stackoverflow.com/questions/15623498/handy-ways-to-show-linearization-of-a-class [2] https://docs.scala-lang.org/overviews/reflection/thread-safety.html