If we're going to be checking `errormask`, we should probably also check it before clearing the error earlier in the function.