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

View File

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