From 837a59085943064c90e2ed2c546c5cbba25ee86d Mon Sep 17 00:00:00 2001 From: Engincan VESKE Date: Mon, 1 Nov 2021 18:00:34 +0300 Subject: [PATCH] Cli: Write only error messages on login command --- .../Volo/Abp/Cli/Commands/LoginCommand.cs | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginCommand.cs index f03c101c88..1111918932 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginCommand.cs @@ -70,12 +70,20 @@ namespace Volo.Abp.Cli.Commands } } - await AuthService.LoginAsync( - commandLineArgs.Target, - password, - organization - ); - + try + { + await AuthService.LoginAsync( + commandLineArgs.Target, + password, + organization + ); + } + catch (Exception ex) + { + Logger.LogError(ex.Message); + return; + } + Logger.LogInformation($"Successfully logged in as '{commandLineArgs.Target}'"); }