public Error getError ( ) { if ( isOk ( ) ) return error ; try { JAXBContext context = JAXBContext . newInstance ( Error . class ) ; Unmarshaller unmarshaller = context . createUnmarshaller ( ) ; StringReader xml = new StringReader ( content ) ; if ( ! content . isEmpty ( ) ) error = ( Error ) unmarshaller . unmarshal ( new StreamSource ( xml ) ) ; } catch ( JAXBException e ) { e . printStackTrace ( ) ; } return error ; }
Return an Error object with the error that have occurred or null .