diff options
| author | bunnei <bunneidev@gmail.com> | 2018-08-11 19:25:30 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-11 19:25:30 -0400 |
| commit | bc286c169fb8b07d21e082e05152cfd6bc611b33 (patch) | |
| tree | 512bc4cca3adbe98a16cae454377c2ec2638b5e3 /src/core/file_sys/partition_filesystem.cpp | |
| parent | 670a2c1f80b906f384d9c61a27436c57c685abcb (diff) | |
| parent | 8069fbd37f45637d90b6a90ab5d1e2e151ad9efd (diff) | |
Merge pull request #970 from DarkLordZach/loader-errors
loader: Add more descriptive errors
Diffstat (limited to 'src/core/file_sys/partition_filesystem.cpp')
| -rw-r--r-- | src/core/file_sys/partition_filesystem.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/file_sys/partition_filesystem.cpp b/src/core/file_sys/partition_filesystem.cpp index 47e032b19..c377edc9c 100644 --- a/src/core/file_sys/partition_filesystem.cpp +++ b/src/core/file_sys/partition_filesystem.cpp @@ -24,19 +24,19 @@ bool PartitionFilesystem::Header::HasValidMagicValue() const { PartitionFilesystem::PartitionFilesystem(std::shared_ptr<VfsFile> file) { // At least be as large as the header if (file->GetSize() < sizeof(Header)) { - status = Loader::ResultStatus::Error; + status = Loader::ResultStatus::ErrorBadPFSHeader; return; } // For cartridges, HFSs can get very large, so we need to calculate the size up to // the actual content itself instead of just blindly reading in the entire file. if (sizeof(Header) != file->ReadObject(&pfs_header)) { - status = Loader::ResultStatus::Error; + status = Loader::ResultStatus::ErrorBadPFSHeader; return; } if (!pfs_header.HasValidMagicValue()) { - status = Loader::ResultStatus::ErrorInvalidFormat; + status = Loader::ResultStatus::ErrorBadPFSHeader; return; } @@ -51,7 +51,7 @@ PartitionFilesystem::PartitionFilesystem(std::shared_ptr<VfsFile> file) { const size_t total_size = file_data.size(); if (total_size != metadata_size) { - status = Loader::ResultStatus::Error; + status = Loader::ResultStatus::ErrorIncorrectPFSFileSize; return; } |
