Code example for SAXParseException

Methods: getException, getLineNumber, getMessage, getSystemId

0
            fileReader.close();
            bufferedReader.close();
        } catch (SAXParseException spe) {
            // Error generated by the parser 
            Log.err("\n** Parsing error" 
                    + ", line " + spe.getLineNumber()
                    + ", uri " + spe.getSystemId(), PropLoader.class);
            Log.err("   " + spe.getMessage() , PropLoader.class);
 
            // Use the contained exception, if any 
            Exception  x = spe;
            if (spe.getException() != null)
                x = spe.getException();
            x.printStackTrace();
        } catch (SAXException sxe) {
            // Error generated by this application 
            // (or a parser-initialization error) 
            Exception  x = sxe;
            if (sxe.getException() != null)
                x = sxe.getException();
            x.printStackTrace();