private static string GetStringFromType(RedditApiExceptionType type) { switch (type) { case RedditApiExceptionType.Connection: return "A connection error has occured. Please try again"; case RedditApiExceptionType.Parse: return "The data received was not in its intented format. Please try again"; case RedditApiExceptionType.NotAuthed: return "You're not currently logged in or your password has changed."; default: return "An unspecified error has occurred"; } }
public RedditApiException(RedditApiExceptionType type) : base(GetStringFromType(type)) { this.ExceptionType = type; }