Skip to content

Commit

Permalink
added additional output for Security Exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
benPearce1 committed May 18, 2018
1 parent 3e98155 commit 3162f97
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions source/Octopus.Cli/CliProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,18 @@ static int PrintError(Exception ex)
return lastExit;
}

var securityException = ex as OctopusSecurityException;
if (securityException != null)
{
if (!string.IsNullOrWhiteSpace(securityException.HelpText))
{
Log.Error(securityException.HelpText);
}

Log.Error(securityException.Message);
return -5;
}

var cmd = ex as CommandException;
if (cmd != null)
{
Expand All @@ -147,11 +159,11 @@ static int PrintError(Exception ex)
var reflex = ex as ReflectionTypeLoadException;
if (reflex != null)
{
Log.Error(ex, "");
Log.Error(ex, string.Empty);

foreach (var loaderException in reflex.LoaderExceptions)
{
Log.Error(loaderException, "");
Log.Error(loaderException, string.Empty);
}

return -43;
Expand All @@ -165,7 +177,7 @@ static int PrintError(Exception ex)
return -7;
}

Log.Error(ex, "");
Log.Error(ex, string.Empty);
return -3;
}
}
Expand Down

0 comments on commit 3162f97

Please sign in to comment.