summaryrefslogtreecommitdiff
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-07-30 12:46:23 -0400
committerGravatar Zach Hilman2018-08-01 00:16:54 -0400
commit187d8e215fb157edaa9f3976bebba9a9a7ed103d (patch)
tree140cbfbd109281adc87c9c79ee07976ba54888cd /src/core/file_sys
parentUse static const instead of const static (diff)
downloadyuzu-187d8e215fb157edaa9f3976bebba9a9a7ed103d.tar.gz
yuzu-187d8e215fb157edaa9f3976bebba9a9a7ed103d.tar.xz
yuzu-187d8e215fb157edaa9f3976bebba9a9a7ed103d.zip
Use more descriptive error codes and messages
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/content_archive.cpp10
1 files changed, 8 insertions, 2 deletions
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_)) {
156 encrypted = true; 156 encrypted = true;
157 } else { 157 } else {
158 if (!keys.HasKey(Core::Crypto::S256KeyType::Header)) 158 if (!keys.HasKey(Core::Crypto::S256KeyType::Header))
159 status = Loader::ResultStatus::ErrorEncrypted; 159 status = Loader::ResultStatus::ErrorMissingKeys;
160 else 160 else
161 status = Loader::ResultStatus::ErrorInvalidFormat; 161 status = Loader::ResultStatus::ErrorDecrypting;
162 return; 162 return;
163 } 163 }
164 } 164 }
@@ -194,6 +194,9 @@ NCA::NCA(VirtualFile file_) : file(std::move(file_)) {
194 if (dec != nullptr) { 194 if (dec != nullptr) {
195 files.emplace_back(); 195 files.emplace_back();
196 romfs = files.back(); 196 romfs = files.back();
197 } else {
198 status = Loader::ResultStatus::ErrorMissingKeys;
199 return;
197 } 200 }
198 } else if (section.raw.header.filesystem_type == NCASectionFilesystemType::PFS0) { 201 } else if (section.raw.header.filesystem_type == NCASectionFilesystemType::PFS0) {
199 u64 offset = (static_cast<u64>(header.section_tables[i].media_offset) * 202 u64 offset = (static_cast<u64>(header.section_tables[i].media_offset) *
@@ -211,6 +214,9 @@ NCA::NCA(VirtualFile file_) : file(std::move(file_)) {
211 if (IsDirectoryExeFS(dirs.back())) 214 if (IsDirectoryExeFS(dirs.back()))
212 exefs = dirs.back(); 215 exefs = dirs.back();
213 } 216 }
217 } else {
218 status = Loader::ResultStatus::ErrorMissingKeys;
219 return;
214 } 220 }
215 } 221 }
216 } 222 }