Find which command generates the error. Set a breakpoint inside check_errors() when, then start adding more calls. Once you've identified the command (a call to check_errors() immediately before it...