From c1f129b96c4fcdd1f6f5ac93cac59670e7bd982e Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 28 Dec 2023 16:11:11 +0800 Subject: [PATCH] Use `AbpIdentityResultException` to replace `AbpException`. --- .../Volo/Abp/Identity/IdentityUserManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs index f2f347944c..33c3c7baaf 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs @@ -491,6 +491,7 @@ public class IdentityUserManager : UserManager, IDomainService } while (tryCount < maxTryCount); } - throw new AbpException($"Could not get a valid user name for the given email address: {email}, allowed characters: {Options.User.AllowedUserNameCharacters}, tried {maxTryCount} times."); + Logger.LogError($"Could not get a valid user name for the given email address: {email}, allowed characters: {Options.User.AllowedUserNameCharacters}, tried {maxTryCount} times."); + throw new AbpIdentityResultException(IdentityResult.Failed(new IdentityErrorDescriber().InvalidUserName(userName))); } }