Browse Source

Move AbpCliExit telemetry to finally block

Ensures that the AbpCliExit activity is always logged by moving the telemetry call to a finally block, regardless of whether an exception occurs.
pull/24395/head
SALİH ÖZKARA 10 months ago
parent
commit
b606047899
  1. 7
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs

7
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs

@ -89,12 +89,13 @@ public class CliService : ITransientDependency
catch (Exception ex)
{
await TelemetryService.AddErrorActivityAsync(ex.Message);
await TelemetryService.AddActivityAsync(ActivityNameConsts.AbpCliExit);
Logger.LogException(ex);
throw;
}
await TelemetryService.AddActivityAsync(ActivityNameConsts.AbpCliExit);
finally
{
await TelemetryService.AddActivityAsync(ActivityNameConsts.AbpCliExit);
}
}
private async Task RunPromptAsync()

Loading…
Cancel
Save