*
* @param e the exception.
* @return true if the exception was mapped, otherwise false.
*/
public boolean mapException(Throwable e) {
ExceptionMapper em = wa.getExceptionMapperContext().find(e.getClass());
if (em == null) return false;
if (request.isTracingEnabled()) {
request.trace(String.format("matched exception mapper: %s -> %s",
ReflectionHelper.objectToString(e),
ReflectionHelper.objectToString(em)));
}
try {
Response r = em.toResponse(e);
if (r == null)
r = Response.noContent().build();
onException(e, r, true);
} catch (MappableContainerException ex) {
// If the exception mapper throws a MappableContainerException then