Skip to content

Commit e3ccbb6

Browse files
committed
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
1 parent 9ddc151 commit e3ccbb6

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,19 @@ private async Task EnsureAbpIoSuccessfulResponseAsync(HttpResponseMessage respon
289289
{
290290
if (responseMessage is { StatusCode: HttpStatusCode.Unauthorized or HttpStatusCode.Forbidden })
291291
{
292-
throw new CliUsageException(
293-
$"Remote server returns '{(int)responseMessage.StatusCode}-{responseMessage.ReasonPhrase}'. " +
294-
"Authentication or license check failed while accessing abp.io. " +
295-
"Please make sure you are logged in with `abp login <username>` and your ABP commercial license is active and covers the requested version. " +
296-
"You can check your license at https://abp.io/my-organizations"
297-
);
292+
var message = $"Remote server returns '{(int)responseMessage.StatusCode}-{responseMessage.ReasonPhrase}'. ";
293+
294+
var serverError = await RemoteServiceExceptionHandler.GetAbpRemoteServiceErrorAsync(responseMessage);
295+
if (!string.IsNullOrWhiteSpace(serverError))
296+
{
297+
message += serverError + " ";
298+
}
299+
300+
message += $"Authentication or license check failed while accessing {CliUrls.WwwAbpIo}. " +
301+
"Please make sure you are logged in with `abp login <username>` and your ABP commercial license is active and covers the requested version. " +
302+
$"You can check your license at {CliUrls.WwwAbpIo}my-organizations";
303+
304+
throw new CliUsageException(message);
298305
}
299306

300307
await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(responseMessage);

0 commit comments

Comments
 (0)