12345678910111213141516171819202122232425262728293031 |
- using System;
- namespace ArcToolkitCLI.Util
- {
- public static class Errors
- {
- public enum ErrorCodes
- {
- NotAFile = 100,
- UnknownArcType,
- KeyNotFound,
- InvalidKeyFile,
- NoCorrectKey
- }
- public static readonly string[] ErrorMessages =
- {
- "{0} is not a file",
- "{0} is not a known ARC file",
- "No key specified or the key file does not exist",
- "The provided keyfile is not valid",
- "The ARC {0} needs a key from {1}"
- };
- public static int Error(ErrorCodes code, params object[] args)
- {
- Console.Error.WriteLine(ErrorMessages[code - ErrorCodes.NotAFile], args);
- return (int) code;
- }
- }
- }
|