1
2
3
4
5
6
7 package org.mule.config;
8
9 import org.mule.api.MuleException;
10 import org.mule.api.config.ExceptionReader;
11
12 import java.util.Collections;
13 import java.util.Map;
14
15
16
17
18 public final class MuleExceptionReader implements ExceptionReader
19 {
20
21 public String getMessage(Throwable t)
22 {
23 return t.getMessage();
24 }
25
26 public Throwable getCause(Throwable t)
27 {
28 return t.getCause();
29 }
30
31 public Class<?> getExceptionType()
32 {
33 return MuleException.class;
34 }
35
36
37
38
39
40
41 public Map<?, ?> getInfo(Throwable t)
42 {
43 return (t instanceof MuleException ? ((MuleException) t).getInfo() : Collections.EMPTY_MAP);
44 }
45
46 }