Beispiel #1
0
        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);
        }
Beispiel #2
0
        static public string GetMessageFor(LoginExceptions exception)
        {
            var message = "Unknown exception.";

            switch (exception)
            {
            case LoginExceptions.IncorrectCredentials:
                message = "Wrong username or password.";
                break;
            }

            return(message);
        }
Beispiel #3
0
 public LoginException(string message, LoginExceptions errorCode) : base(message)
 {
     this.HResult = (int)errorCode;
 }