View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.api.config;
8   
9   import java.util.Map;
10  
11  /**
12   * Provides a strategy interface for reading information from an exception in a
13   * consistent way. For example JMS 1.0.2b uses linkedExceptions rather that 'cause'
14   * and SQLExceptions hold additional information that can be extracted using this
15   * interface.
16   */
17  public interface ExceptionReader
18  {
19  
20      String getMessage(Throwable t);
21  
22      Throwable getCause(Throwable t);
23  
24      Class<?> getExceptionType();
25  
26      /**
27       * Returns a map of the non-stanard information stored on the exception
28       * 
29       * @param t the exception to extract the information from
30       * @return a map of the non-stanard information stored on the exception
31       */
32      Map<?, ?> getInfo(Throwable t);
33  
34  }