For debugging/logging purpose, I commonly have to find the root cause of a Failure.
When it is an exception and the failure is composed, I miss something like "messageChain" but which allows to find the deeper exception of the composition.
It is rather easy to build the list of Failure in a composed Failure with a little recursion and then find the first exception (if exists), but it would be even cooler if it was a built-in method of Failure, something like:
Failure#exceptionChain : List[Throwable] (deeper first ?)
Failure#getCause : Option[Throwable] (only the deepest ?)
Failure#failureChain : Seq[Failure] (deepest first ?)
For consistency with the Java class Throwable I would prefer, that a method getCause will return only the immediate cause of a Failure, but not the deepest one.
For the latter I would suggest a name like getOriginalCause or getDeepestCause.
(In [[r:18d569232ef2c75d135fd7dad73847bb842fe188]]) Closes #856. Makes Box a first class citizen in Loggable
Closes #861. Additional goodies for getting Exceptions from Failure
Ref #886. Makes user agent stuff more flexible
Imported from Assembla: http://www.assembla.com/spaces/liftweb/tickets/861