public static ExceptionDescriptor parseStackTrace ( final Collection < String > lines ) { if ( ( lines == null ) || lines . isEmpty ( ) ) { throw new IllegalArgumentException ( "No stack trace provided." ) ; } try { final Builder b = new Builder ( ) ; final Collection < ExceptionLine > parsedLines = new ExceptionParser ( ) . parse ( lines ) ; parsedLines . forEach ( b :: addLine ) ; return b . build ( ) ; } catch ( final ExceptionParseException e ) { // FIXME provides no information as to why there's no exception // found return null ; } }
Take a chunk of log and try to parse an exception out of it .