public static string GetMessage(OriginatorErrorCode errorCode) { switch (errorCode) { case OriginatorErrorCode.Empty: return("No originator specified"); case OriginatorErrorCode.TooLong: return("Too long originator"); case OriginatorErrorCode.LeadingZero: return("The originator should not have leading zeros"); case OriginatorErrorCode.NonNumeric: return("The originator is not numeric"); case OriginatorErrorCode.UnsupportedChars: return("The alpha originator had unsupported characters. Please set the 'strict' flag to false to (try to) use unsupported characters."); default: throw new ArgumentOutOfRangeException(nameof(errorCode), errorCode, null); } }
/// <summary> /// Constructor /// </summary> /// <param name="errorCode">The error code</param> public OriginatorException(OriginatorErrorCode errorCode) : base(ErrorCodeSupport.GetMessage(errorCode)) { ErrorCode = errorCode; }