From e3ccbb6fbef01609f6baebf8a56f7b4bc8c51b5e Mon Sep 17 00:00:00 2001 From: maliming Date: Sat, 16 May 2026 11:37:33 +0800 Subject: [PATCH] Address Copilot review feedback (round 3) - Use CliUrls.WwwAbpIo instead of hardcoded abp.io host/URL in the 401/403 license hint, so dev/staging environments show the right URL - Include server-provided RemoteServiceErrorResponse details (e.g. Code: LicenseExpired) in the CliUsageException message when available --- .../ProjectBuilding/AbpIoSourceCodeStore.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs index 3ee8c5c7f3..257e12d0dc 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs @@ -289,12 +289,19 @@ public class AbpIoSourceCodeStore : ISourceCodeStore, ITransientDependency { if (responseMessage is { StatusCode: HttpStatusCode.Unauthorized or HttpStatusCode.Forbidden }) { - throw new CliUsageException( - $"Remote server returns '{(int)responseMessage.StatusCode}-{responseMessage.ReasonPhrase}'. " + - "Authentication or license check failed while accessing abp.io. " + - "Please make sure you are logged in with `abp login ` and your ABP commercial license is active and covers the requested version. " + - "You can check your license at https://abp.io/my-organizations" - ); + var message = $"Remote server returns '{(int)responseMessage.StatusCode}-{responseMessage.ReasonPhrase}'. "; + + var serverError = await RemoteServiceExceptionHandler.GetAbpRemoteServiceErrorAsync(responseMessage); + if (!string.IsNullOrWhiteSpace(serverError)) + { + message += serverError + " "; + } + + message += $"Authentication or license check failed while accessing {CliUrls.WwwAbpIo}. " + + "Please make sure you are logged in with `abp login ` and your ABP commercial license is active and covers the requested version. " + + $"You can check your license at {CliUrls.WwwAbpIo}my-organizations"; + + throw new CliUsageException(message); } await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(responseMessage);