improved loop, removed status code from custom error, inverse branches in Attempt.StatusCode()