dotnet-installer/src/Microsoft.DotNet.Cli.Utils/GracefulException.cs
Jon Sequeira e8c5d23c29 display CommandParsingException gracefully (#5493)
* display CommandParsing gracefully

This set of changes handles CommandParsingException gracefuly (so as not to show the user a stack trace) and generalizes graceful exception display somewhat away from being type-specific.

* fix compile error by inlining constant

* remove unused test logging
2017-01-30 14:36:44 -08:00

21 lines
No EOL
613 B
C#

using System;
namespace Microsoft.DotNet.Cli.Utils
{
public class GracefulException : Exception
{
public GracefulException(string message) : base(message)
{
Data.Add(ExceptionExtensions.CLI_User_Displayed_Exception, true);
}
public GracefulException(string format, params string[] args) : this(string.Format(format, args))
{
}
public GracefulException(string message, Exception innerException) : base(message, innerException)
{
Data.Add(ExceptionExtensions.CLI_User_Displayed_Exception, true);
}
}
}