Code: Select all
catch (Exception e)
{
if (e.Message == "The username or password supplied is invalid.")
{
// handle invalid credentials
}
}
Moderator: SourceGear
Code: Select all
catch (Exception e)
{
if (e.Message == "The username or password supplied is invalid.")
{
// handle invalid credentials
}
}
Code: Select all
try { ... }
catch (Exception ex)
{
int nStatusCode = VaultConnection.GetSoapExceptionStatusCodeInt(ex);
if (VaultLib.VaultStatusCodeFailNotValidLogin == nStatusCode) { System.Console.WriteLine("invalid login: " + VaultLib.GetSoapExceptionMessage(nStatusCode)); }
else if (nStatusCode != -1) { System.Console.WriteLine("Error was: " + VaultLib.GetSoapExceptionMessage(nStatusCode)); }
else /* nStatusCode == -1 */ { System.Console.WriteLine("This is not a Vault Protocol exception : " + ex.Message); }
}