01: /*
02: * $Id: DefaultExceptionReader.java 10489 2008-01-23 17:53:38Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.config;
12:
13: import org.mule.api.config.ExceptionReader;
14:
15: import java.util.HashMap;
16: import java.util.Map;
17:
18: /**
19: * This is the default exception reader used if there is no specific one registered
20: * for the current exception.
21: */
22: public final class DefaultExceptionReader implements ExceptionReader {
23:
24: private Map info = new HashMap();
25:
26: public String getMessage(Throwable t) {
27: return t.getMessage();
28: }
29:
30: public Throwable getCause(Throwable t) {
31: return t.getCause();
32: }
33:
34: public Class getExceptionType() {
35: return Throwable.class;
36: }
37:
38: /**
39: * Returns a map of the non-stanard information stored on the exception
40: *
41: * @return a map of the non-stanard information stored on the exception
42: */
43: public Map getInfo(Throwable t) {
44: return info;
45: }
46: }
|