Create Enum for exit codes
This commit is contained in:
parent
2b85caeb29
commit
fe5e2cb80f
3 changed files with 27 additions and 8 deletions
19
Geekbot.net/Lib/GeekbotExitCode.cs
Normal file
19
Geekbot.net/Lib/GeekbotExitCode.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
namespace Geekbot.net.Lib
|
||||
{
|
||||
public enum GeekbotExitCode : int
|
||||
{
|
||||
// General
|
||||
Clean = 0,
|
||||
InvalidArguments = 1,
|
||||
|
||||
// Geekbot Internals
|
||||
TranslationsFailed = 201,
|
||||
|
||||
// Dependent Services
|
||||
RedisConnectionFailed = 301,
|
||||
|
||||
// Discord Related
|
||||
CouldNotLogin = 401
|
||||
|
||||
}
|
||||
}
|
|
@ -72,7 +72,7 @@ namespace Geekbot.net.Lib.Localization
|
|||
catch (Exception e)
|
||||
{
|
||||
_logger.Error(LogSource.Geekbot, "Failed to load Translations", e);
|
||||
Environment.Exit(110);
|
||||
Environment.Exit(GeekbotExitCode.TranslationsFailed.GetHashCode());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,8 +114,8 @@ namespace Geekbot.net.Lib.Localization
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.Error(LogSource.Geekbot, "lol nope", e);
|
||||
return new Dictionary<string, string>();
|
||||
_logger.Error(LogSource.Geekbot, "No translations for command found", e);
|
||||
return new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ namespace Geekbot.net.Lib.Localization
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.Error(LogSource.Geekbot, "lol nope", e);
|
||||
_logger.Error(LogSource.Geekbot, "No translations for command found", e);
|
||||
return new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue