fix(request): fix wrong handling of errors