static public LoginException Create(LoginExceptions exception) { LoginException loginException = new LoginException("Unknown error."); switch (exception) { case LoginExceptions.IncorrectCredentials: loginException = new LoginException(GetMessageFor(LoginExceptions.IncorrectCredentials)); break; } return(loginException); }
static public string GetMessageFor(LoginExceptions exception) { var message = "Unknown exception."; switch (exception) { case LoginExceptions.IncorrectCredentials: message = "Wrong username or password."; break; } return(message); }
public LoginException(string message, LoginExceptions errorCode) : base(message) { this.HResult = (int)errorCode; }