preserve the error code

otherwise it'd be cleared by a subsequent calls