private bool TryHandleTokenValidation()

in src/Covi/Features/Account/Services/Authentication/AuthenticationServiceErrorHandler.cs [65:91]


        private bool TryHandleTokenValidation(
            List<ResponseInnerError> errors,
            out Exception generatedException)
        {
            var userTokenErrors = new List<string>();

            foreach (var errorItem in errors)
            {
                if (ResponseErrorCode.UserToken.IsError(errorItem.ErrorTarget))
                {
                    userTokenErrors.Add(Localization.CreateProfileValidationException_TokenIsEmpty_ErrorText);
                }
                else if (ResponseErrorCode.DuplicateUserToken.IsError(errorItem.ErrorTarget))
                {
                    userTokenErrors.Add(Localization.CreateProfileValidationException_DuplicateUserToken_ErrorText);
                }
            }

            if (userTokenErrors.Any())
            {
                generatedException = new CreateProfileTokenValidationException(userTokenErrors);
                return true;
            }

            generatedException = null;
            return false;
        }