-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5172364
commit 1482d03
Showing
30 changed files
with
247 additions
and
193 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace Confix.Tool; | ||
|
||
public static class ThrowHelper | ||
{ | ||
public static Exception InvalidVariableName(string name) | ||
=> new ExitException($"Invalid variable name: {name}") | ||
{ | ||
Help = "Variable name must be like: [blue]$provider:some.path[/]" | ||
}; | ||
|
||
public static Exception InvalidProviderName( | ||
IEnumerable<string> providers, | ||
string name) | ||
=> throw new ExitException($"Invalid provider name: {name}") | ||
{ | ||
Help = $"Available providers: {string.Join(", ", providers)}" | ||
}; | ||
|
||
public static Exception EnvironmentDoesNotExist(string name) | ||
=> new ExitException($"Environment '{name}' does not exists.") | ||
{ | ||
Help = $"Use [blue]confix environment set {name}[/] to change it." | ||
}; | ||
|
||
public static Exception VariableNotFound(string name) => | ||
throw new ExitException($"Variable not found: {name}") | ||
{ | ||
Help = "Run [blue]confix variable list[/] to see all available variables." | ||
}; | ||
|
||
public static Exception CouldNotParseJsonFile(FileInfo file) | ||
=> throw new ExitException($"File {file.FullName} has invalid content."); | ||
} |
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
Oops, something went wrong.