public void checkIfShouldExit()
    {
        if (errors > 0)
        {
            throw new IllegalStateException("had " + errors + (errors > 1 ? " errors" : " error"));
        }
        else if (warnings > 0 && warningsFatal)
        {
            throw new IllegalStateException("had " + warnings + (warnings > 1 ? " warnings" : " warning"));
        }
    }
Check if the parser should exit.

@throws IllegalStateException if there are errors or warnings recorded.
sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/ErrorHandler.java