Create Enum for exit codes

This commit is contained in:
runebaas 2018-05-06 02:00:45 +02:00
parent 2b85caeb29
commit fe5e2cb80f
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
3 changed files with 27 additions and 8 deletions

View 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
}
}

View file

@ -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>();
}
}