1 18 19 package org.apache.jmeter.protocol.http.modifier; 20 21 import org.apache.jorphan.logging.LoggingManager; 22 import org.apache.log.Logger; 23 import org.xml.sax.ErrorHandler ; 24 import org.xml.sax.SAXException ; 25 import org.xml.sax.SAXParseException ; 26 27 33 public class UserParameterXMLErrorHandler implements ErrorHandler 34 { 35 transient private static Logger log = LoggingManager.getLoggerForClass(); 36 37 public void warning(SAXParseException exception) throws SAXException 38 { 39 log.warn( 40 "**Parsing Warning**\n" 41 + " line: " 42 + exception.getLineNumber() 43 + "\n" 44 + " URI: :" 45 + exception.getSystemId() 46 + "\n" 47 + " Message: " 48 + exception.getMessage()); 49 throw new SAXException ("Warning encountered"); 50 } 51 52 public void error(SAXParseException exception) throws SAXException 53 { 54 log.error( 55 "**Parsing Warning**\n" 56 + " line: " 57 + exception.getLineNumber() 58 + "\n" 59 + " URI: :" 60 + exception.getSystemId() 61 + "\n" 62 + " Message: " 63 + exception.getMessage()); 64 throw new SAXException ("Error encountered"); 65 } 66 67 public void fatalError(SAXParseException exception) throws SAXException 68 { 69 log.error( 70 "**Parsing Warning**\n" 71 + " line: " 72 + exception.getLineNumber() 73 + "\n" 74 + " URI: :" 75 + exception.getSystemId() 76 + "\n" 77 + " Message: " 78 + exception.getMessage()); 79 throw new SAXException ("Fatal Error encountered"); 80 } 81 } 82 | Popular Tags |