Checks error condition