Each time getNextDoc() is called, wasDocError() will return true if there was an error processing the previous document, such as a file parsing error, and getDocError() will return the error message.