-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #474 from WildernessLabs/feature/improve-command-e…
…xception Improve usage of logger and command exception
- Loading branch information
Showing
14 changed files
with
65 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
namespace Meadow.CLI | ||
namespace Meadow.CLI; | ||
|
||
public enum CommandExitCode | ||
{ | ||
public enum CommandErrors | ||
{ | ||
Success = 0, | ||
GeneralError = 1, | ||
UserCancelled = 2, | ||
FileNotFound = 3, | ||
DirectoryNotFound = 4, | ||
} | ||
Success = 0, | ||
GeneralError = 1, | ||
UserCancelled = 2, | ||
FileNotFound = 3, | ||
DirectoryNotFound = 4, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
namespace Meadow.CLI; | ||
|
||
/// <inheritdoc/> | ||
public class CommandException : CliFx.Exceptions.CommandException | ||
{ | ||
public CommandException(string message) | ||
: base(message, (int)CommandExitCode.GeneralError, showHelp: false, innerException: null) | ||
{ } | ||
|
||
public CommandException(string message, bool showHelp) | ||
: base(message, (int)CommandExitCode.GeneralError, showHelp, innerException: null) | ||
{ } | ||
|
||
public CommandException(string message, CommandExitCode exitCode) | ||
: base(message, (int)exitCode, showHelp: false, innerException: null) | ||
{ } | ||
|
||
public CommandException(string message, CommandExitCode exitCode, bool showHelp) | ||
: base(message, (int)exitCode, showHelp, innerException: null) | ||
{ } | ||
|
||
public CommandException(string message, Exception innerException) | ||
: base(message, (int)CommandExitCode.GeneralError, showHelp: false, innerException) | ||
{ } | ||
|
||
public CommandException(string message, bool showHelp, Exception innerException) | ||
: base(message, (int)CommandExitCode.GeneralError, showHelp, innerException) | ||
{ } | ||
|
||
public CommandException(string message, CommandExitCode exitCode, Exception innerException) | ||
: base(message, (int)exitCode, showHelp: false, innerException: innerException) | ||
{ } | ||
|
||
public CommandException(string message, CommandExitCode exitCode, bool showHelp, Exception innerException) | ||
: base(message, (int)exitCode, showHelp, innerException: innerException) | ||
{ } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
Source/v2/Meadow.Cli/Commands/Current/Cloud/ApiKey/CloudApiKeyCreateCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
Source/v2/Meadow.Cli/Commands/Current/Cloud/ApiKey/CloudApiKeyDeleteCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
Source/v2/Meadow.Cli/Commands/Current/Cloud/ApiKey/CloudApiKeyListCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
Source/v2/Meadow.Cli/Commands/Current/Cloud/ApiKey/CloudApiKeyUpdateCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
Source/v2/Meadow.Cli/Commands/Current/Cloud/Collection/JsonDocumentBindingConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
Source/v2/Meadow.Cli/Commands/Current/Cloud/Command/CloudCommandPublishCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters