private static string LookupReason(NoTokenReason reason) { if (reason == NoTokenReason.EndOfString) { return("End of string"); } else { throw new ArgumentException("Unknown reason: " + reason); } }
private static string LookupReason(NoTokenReason reason) { if(reason == NoTokenReason.EndOfString) { return "End of string"; } else { throw new ArgumentException("Unknown reason: " + reason); } }
/// <summary> /// Creates an exception given a message and a reason why no token was provided /// </summary> /// <param name="msg">The exception message</param> /// <param name="reason">The reason why no token was provided</param> public DocumentRenderException(string msg, NoTokenReason reason) : base(msg + ": " + LookupReason(reason)) { }