Using new Enum value for MEGA ApiResultCode

This commit is contained in:
erri120 2020-04-10 12:47:29 +02:00
parent a864677463
commit d25915c4f5
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135

View File

@ -44,12 +44,10 @@ namespace Wabbajack.Lib.Downloaders
}
catch (ApiException e)
{
if ((int)e.ApiResultCode == -26)
{
return new LoginReturnMessage("Two-Factor Authentication needs to be disabled before login!", true);
}
return e.ApiResultCode switch
{
ApiResultCode.TwoFactorAuthenticationError => new LoginReturnMessage(
$"Two-Factor Authentication needs to be disabled before login! {e.Message}", true),
ApiResultCode.InternalError => new LoginReturnMessage(
$"Internal error occured! Please report this to the Wabbajack Team! {e.Message}", true),
_ => new LoginReturnMessage($"Error during login: {e.Message}", true)