1 10 11 package org.mule.providers.soap.axis; 12 13 import org.apache.axis.AxisFault; 14 import org.mule.config.ExceptionReader; 15 16 import java.util.HashMap ; 17 import java.util.Iterator ; 18 import java.util.Map ; 19 20 27 public class AxisFaultExceptionReader implements ExceptionReader 28 { 29 30 public String getMessage(Throwable t) 31 { 32 AxisFault e = (AxisFault)t; 33 Map props = getInfo(e); 34 StringBuffer msg = new StringBuffer (64); 35 msg.append("("); 36 for (Iterator iterator = props.entrySet().iterator(); iterator.hasNext();) 37 { 38 Map.Entry entry = (Map.Entry )iterator.next(); 39 msg.append(entry.getKey()).append(": ").append(entry.getValue()).append(", "); 40 } 41 msg.append(")"); 42 return e.getMessage() + msg.toString(); 43 } 44 45 public Throwable getCause(Throwable t) 46 { 47 AxisFault e = (AxisFault)t; 48 Throwable cause = e.detail; 49 if (cause == null) 50 { 51 cause = e.getCause(); 52 } 53 return cause; 54 } 55 56 public Class getExceptionType() 57 { 58 return AxisFault.class; 59 } 60 61 66 public Map getInfo(Throwable t) 67 { 68 AxisFault e = (AxisFault)t; 69 Map info = new HashMap (); 70 info.put("Fault", e.getFaultString()); 71 info.put("Fault Code", e.getFaultCode().toString()); 72 info.put("Fault Actor", e.getFaultActor()); 73 info.put("Fault Node", e.getFaultNode()); 74 info.put("Fault Reason", e.getFaultReason()); 75 info.put("Fault Role", e.getFaultRole()); 76 info.put("Fault Dump", e.dumpToString()); 77 return info; 80 } 81 } 82 | Popular Tags |