Skip to content

Commit

Permalink
decomp: more descriptive error messages (#1178)
Browse files Browse the repository at this point in the history
  • Loading branch information
xTVaser authored Feb 17, 2022
1 parent 78e5fc0 commit 74d0025
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions decompiler/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,21 @@ int main(int argc, char** argv) {

// Verify the in_folder is correct
// TODO - refactor to use ghc::filesystem, cleanup file_util
if (!file_util::file_exists(in_folder) ||
(!config.expected_elf_name.empty() &&
!file_util::file_exists(file_util::combine_path(in_folder, config.expected_elf_name)))) {
printf("Aborting - 'in_folder' does not exist or does not contain the expected files\n");
if (!file_util::file_exists(in_folder)) {
fmt::print("Aborting - 'in_folder' does not exist '{}'\n", in_folder);
return 1;
}

// Warning message if expected ELF isn't found, user could be using bad assets / didn't extract
// the ISO properly
if (!config.expected_elf_name.empty() &&
!file_util::file_exists(file_util::combine_path(in_folder, config.expected_elf_name))) {
fmt::print(
"WARNING - '{}' does not contain the expected ELF file '{}'. Was the ISO extracted "
"properly or is there a version mismatch?\n",
in_folder, config.expected_elf_name);
}

std::vector<std::string> dgos, objs, strs;
for (const auto& dgo_name : config.dgo_names) {
dgos.push_back(file_util::combine_path(in_folder, dgo_name));
Expand Down

0 comments on commit 74d0025

Please sign in to comment.