1 12 package org.openbravo.xmlEngine; 13 14 23 import org.apache.log4j.Logger ; 24 25 public class ErrorManagement { 26 27 static Logger log4jErrorManagement = Logger.getLogger(ErrorManagement.class); 28 29 public static void error(int i, String locationText) { 30 error(i, locationText, null); 31 } 32 33 public static void error(int i, String locationText, Exception e) { 34 String errorText = ""; 35 switch(i) { 36 case 101: 37 errorText = "Data not defined for structure"; 38 break; 41 case 102: 42 errorText = "Not found fileXmlEngineConfiguration"; 43 break; 45 case 103: 46 errorText = "IOException in fileXmlEngineConfiguration"; 47 break; 48 case 104: 49 errorText = "Exception in parsing of fileXmlEngineConfiguration"; 50 break; 53 case 105: 54 errorText = "File of template not defined"; 55 break; 57 case 106: 58 errorText = "Not found fileXmlEngineTemplate"; 59 break; 61 case 107: 62 errorText = "IOException in fileXmlEngineTemplate"; 63 break; 64 case 108: 65 errorText = "Exception in parsing of fileXmlEngineTemplate"; 66 break; 69 } 70 log4jErrorManagement.error(errorText); 71 log4jErrorManagement.error("in " + locationText); 72 if (log4jErrorManagement.isDebugEnabled() && e != null) { 73 e.getMessage(); 74 e.printStackTrace(); 75 } 76 77 } 78 79 } 80
| Popular Tags
|