Create and use InvalidFirmwarePackageException
This commit is contained in:
parent
dffd92483f
commit
070f4ee122
2 changed files with 17 additions and 8 deletions
|
@ -0,0 +1,9 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Ryujinx.HLE.Exceptions
|
||||||
|
{
|
||||||
|
class InvalidFirmwarePackageException : Exception
|
||||||
|
{
|
||||||
|
public InvalidFirmwarePackageException(string message) : base(message) { }
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +1,9 @@
|
||||||
using LibHac;
|
using LibHac;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.FsService;
|
|
||||||
using LibHac.FsSystem;
|
using LibHac.FsSystem;
|
||||||
using LibHac.FsSystem.NcaUtils;
|
using LibHac.FsSystem.NcaUtils;
|
||||||
using LibHac.Ncm;
|
using LibHac.Ncm;
|
||||||
using Ryujinx.HLE.HOS.Font;
|
using Ryujinx.HLE.Exceptions;
|
||||||
using Ryujinx.HLE.HOS.Services.Time;
|
using Ryujinx.HLE.HOS.Services.Time;
|
||||||
using Ryujinx.HLE.Utilities;
|
using Ryujinx.HLE.Utilities;
|
||||||
using System;
|
using System;
|
||||||
|
@ -13,8 +12,6 @@ using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
using static Ryujinx.Common.HexUtils;
|
|
||||||
|
|
||||||
namespace Ryujinx.HLE.FileSystem.Content
|
namespace Ryujinx.HLE.FileSystem.Content
|
||||||
{
|
{
|
||||||
internal class ContentManager
|
internal class ContentManager
|
||||||
|
@ -367,7 +364,7 @@ namespace Ryujinx.HLE.FileSystem.Content
|
||||||
InstallFromCart(xci, temporaryDirectory);
|
InstallFromCart(xci, temporaryDirectory);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new FormatException("Input file is not a valid firmware package");
|
throw new InvalidFirmwarePackageException("Input file is not a valid firmware package");
|
||||||
}
|
}
|
||||||
|
|
||||||
FinishInstallation(temporaryDirectory, registeredDirectory);
|
FinishInstallation(temporaryDirectory, registeredDirectory);
|
||||||
|
@ -523,7 +520,10 @@ namespace Ryujinx.HLE.FileSystem.Content
|
||||||
return VerifyAndGetVersion(partition);
|
return VerifyAndGetVersion(partition);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
throw new InvalidDataException("Update not found in xci file.");
|
{
|
||||||
|
throw new InvalidFirmwarePackageException("Update not found in xci file.");
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -684,7 +684,7 @@ namespace Ryujinx.HLE.FileSystem.Content
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new InvalidDataException($"Firmware package contains unrelated archives. Please remove these paths: \n{extraNcas}");
|
throw new InvalidFirmwarePackageException($"Firmware package contains unrelated archives. Please remove these paths: \n{extraNcas}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -815,7 +815,7 @@ namespace Ryujinx.HLE.FileSystem.Content
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new InvalidDataException($"Firmware package contains unrelated archives. Please remove these paths: \n{extraNcas}");
|
throw new InvalidFirmwarePackageException($"Firmware package contains unrelated archives. Please remove these paths: \n{extraNcas}");
|
||||||
}
|
}
|
||||||
|
|
||||||
return systemVersion;
|
return systemVersion;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue