Return a nonzero value on error