when an exception type is registered twice.
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] http://stackoverflow.com/questions/15623498/handy-ways-to-show-linearization-of-a-class [2] http://docs.scala-lang.org/overviews/reflection/thread-safety.html
A class to register ExceptionMappers and handle exceptions.
Given some exception, an ExceptionManager will find an ExceptionMapper to handle that particular class of exceptions. If the mapper for that exception isn't registered, ExceptionManager will try its parent class, and so on, until it reaches the Throwable class. At that point the DefaultExceptionMapper will run which should be defined over all Throwables.
when an exception type is registered twice.
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] http://stackoverflow.com/questions/15623498/handy-ways-to-show-linearization-of-a-class [2] http://docs.scala-lang.org/overviews/reflection/thread-safety.html