Add a com.twitter.finatra.thrift.exceptions.ExceptionMapper over type T to the manager.
Add a com.twitter.finatra.thrift.exceptions.ExceptionMapper over type T to the manager. If a mapper has already been added for the given T, it will be replaced.
- exception class type which should be a subclass of java.lang.Throwable
- com.twitter.finatra.thrift.exceptions.ExceptionMapper to add
Add a com.twitter.finatra.thrift.exceptions.ExceptionMapper by type T
Add a com.twitter.finatra.thrift.exceptions.ExceptionMapper by type T
- ExceptionMapper type T, which should be a subclass of com.twitter.finatra.thrift.exceptions.ExceptionMapper
Returns a Future[Rep] as computed by the matching com.twitter.finatra.thrift.exceptions.ExceptionMapper to the given throwable.
Returns a Future[Rep] as computed by the matching com.twitter.finatra.thrift.exceptions.ExceptionMapper to the given throwable.
- java.lang.Throwable to match against registered ExceptionMappers.
a response wrapped in Future
A class to register com.twitter.finatra.thrift.exceptions.ExceptionMappers and handle exceptions
Given an exception, the ExceptionManager will find an com.twitter.finatra.thrift.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, until it reaches a Throwable class. If no Throwable class exception mapper is found, it won't handle the exception. Users are free to register their own ExceptionMapper[Throwable] which will be the root exception mapper.