From 187d8e215fb157edaa9f3976bebba9a9a7ed103d Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Mon, 30 Jul 2018 12:46:23 -0400 Subject: Use more descriptive error codes and messages --- src/core/file_sys/content_archive.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/core/file_sys') diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp index cb59c0a2b..2deb727cc 100644 --- a/src/core/file_sys/content_archive.cpp +++ b/src/core/file_sys/content_archive.cpp @@ -156,9 +156,9 @@ NCA::NCA(VirtualFile file_) : file(std::move(file_)) { encrypted = true; } else { if (!keys.HasKey(Core::Crypto::S256KeyType::Header)) - status = Loader::ResultStatus::ErrorEncrypted; + status = Loader::ResultStatus::ErrorMissingKeys; else - status = Loader::ResultStatus::ErrorInvalidFormat; + status = Loader::ResultStatus::ErrorDecrypting; return; } } @@ -194,6 +194,9 @@ NCA::NCA(VirtualFile file_) : file(std::move(file_)) { if (dec != nullptr) { files.emplace_back(); romfs = files.back(); + } else { + status = Loader::ResultStatus::ErrorMissingKeys; + return; } } else if (section.raw.header.filesystem_type == NCASectionFilesystemType::PFS0) { u64 offset = (static_cast(header.section_tables[i].media_offset) * @@ -211,6 +214,9 @@ NCA::NCA(VirtualFile file_) : file(std::move(file_)) { if (IsDirectoryExeFS(dirs.back())) exefs = dirs.back(); } + } else { + status = Loader::ResultStatus::ErrorMissingKeys; + return; } } } -- cgit v1.2.3