1 25 package org.ofbiz.service; 26 27 import java.util.LinkedList ; 28 import java.util.List ; 29 import java.util.Map ; 30 31 import org.ofbiz.base.util.Debug; 32 33 40 public class GeneralServiceException extends org.ofbiz.base.util.GeneralException { 41 42 protected List errorMsgList = null; 43 protected Map errorMsgMap = null; 44 protected Map nestedServiceResult = null; 45 46 public GeneralServiceException() { 47 super(); 48 } 49 50 public GeneralServiceException(String str) { 51 super(str); 52 } 53 54 public GeneralServiceException(String str, Throwable nested) { 55 super(str, nested); 56 } 57 58 public GeneralServiceException(Throwable nested) { 59 super(nested); 60 } 61 62 public GeneralServiceException(String str, List errorMsgList, Map errorMsgMap, Map nestedServiceResult, Throwable nested) { 63 super(str, nested); 64 this.errorMsgList = errorMsgList; 65 this.errorMsgMap = errorMsgMap; 66 this.nestedServiceResult = nestedServiceResult; 67 } 68 69 public Map returnError(String module) { 70 String errMsg = this.getMessage() == null ? "Error in Service" : this.getMessage(); 71 if (this.getNested() != null) { 72 Debug.logError(this.getNested(), errMsg, module); 73 } 74 return ServiceUtil.returnError(errMsg, this.errorMsgList, this.errorMsgMap, this.nestedServiceResult); 75 } 76 77 public void addErrorMessages(List errMsgs) { 78 if (this.errorMsgList == null) { 79 this.errorMsgList = new LinkedList (); 80 } 81 this.errorMsgList.addAll(errMsgs); 82 } 83 } 84 | Popular Tags |