1
2
3
4
5
6
7
8
9
10
11 package org.mule.providers.jms;
12
13 import org.mule.config.ExceptionReader;
14
15 import java.util.HashMap;
16 import java.util.Map;
17
18 import javax.jms.JMSException;
19
20
21
22
23
24 public class JmsExceptionReader implements ExceptionReader
25 {
26
27 public String getMessage(Throwable t)
28 {
29 JMSException e = (JMSException)t;
30 return e.getMessage() + "(JMS Code: " + e.getErrorCode() + ")";
31 }
32
33 public Throwable getCause(Throwable t)
34 {
35 JMSException e = (JMSException)t;
36 Throwable cause = e.getLinkedException();
37 if (cause == null)
38 {
39 cause = e.getCause();
40 }
41 return cause;
42 }
43
44 public Class getExceptionType()
45 {
46 return JMSException.class;
47 }
48
49
50
51
52
53
54 public Map getInfo(Throwable t)
55 {
56 JMSException e = (JMSException)t;
57 Map info = new HashMap();
58 info.put("JMS Code", e.getErrorCode());
59 return info;
60 }
61
62 }