diff --git a/src/LibHac/Tools/FsSystem/Messages.cs b/src/LibHac/Tools/FsSystem/Messages.cs index 91297d28..7af3dae7 100644 --- a/src/LibHac/Tools/FsSystem/Messages.cs +++ b/src/LibHac/Tools/FsSystem/Messages.cs @@ -3,7 +3,7 @@ internal static class Messages { public static string DestSpanTooSmall => "Destination array is not long enough to hold the requested data."; - public static string NcaSectionMissing => "NCA section does not exist."; + public static string NcaSectionMissing => "NCA section {0} does not exist."; public static string DestPathIsSubPath => "The destination directory is a subdirectory of the source directory."; public static string DestPathAlreadyExists => "Destination path already exists."; public static string PartialPathNotFound => "Could not find a part of the path."; diff --git a/src/LibHac/Tools/FsSystem/NcaUtils/Nca.cs b/src/LibHac/Tools/FsSystem/NcaUtils/Nca.cs index 80232945..a7532784 100644 --- a/src/LibHac/Tools/FsSystem/NcaUtils/Nca.cs +++ b/src/LibHac/Tools/FsSystem/NcaUtils/Nca.cs @@ -146,7 +146,7 @@ public class Nca private IStorage OpenSectionStorage(int index) { - if (!SectionExists(index)) throw new ArgumentException(nameof(index), Messages.NcaSectionMissing); + if (!SectionExists(index)) throw new ArgumentException(string.Format(Messages.NcaSectionMissing, index), nameof(index)); long offset = Header.GetSectionStartOffset(index); long size = Header.GetSectionSize(index); @@ -796,7 +796,7 @@ public class Nca private IStorage OpenNca0RawStorage(int index, bool openEncrypted) { - if (!SectionExists(index)) throw new ArgumentException(nameof(index), Messages.NcaSectionMissing); + if (!SectionExists(index)) throw new ArgumentException(string.Format(Messages.NcaSectionMissing, index), nameof(index)); long offset = Header.GetSectionStartOffset(index) - 0x400; long size = Header.GetSectionSize(index); diff --git a/src/LibHac/Tools/FsSystem/NcaUtils/NcaExtensions.cs b/src/LibHac/Tools/FsSystem/NcaUtils/NcaExtensions.cs index 712e759a..ed7ae471 100644 --- a/src/LibHac/Tools/FsSystem/NcaUtils/NcaExtensions.cs +++ b/src/LibHac/Tools/FsSystem/NcaUtils/NcaExtensions.cs @@ -55,7 +55,7 @@ public static class NcaExtensions public static Validity ValidateSectionMasterHash(this Nca nca, int index) { - if (!nca.SectionExists(index)) throw new ArgumentException(nameof(index), Messages.NcaSectionMissing); + if (!nca.SectionExists(index)) throw new ArgumentException(string.Format(Messages.NcaSectionMissing, index), nameof(index)); if (!nca.CanOpenSection(index)) return Validity.MissingKey; NcaFsHeader header = nca.GetFsHeader(index);