Skip to content

Commit

Permalink
launcher: throw runtime error instead of char const*
Browse files Browse the repository at this point in the history
  • Loading branch information
muttleyxd committed Mar 12, 2022
1 parent 65d9923 commit 21a891d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/arma3-unix-launcher/html_preset_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace
if (!data_type.empty())
return child.text().get();
}
throw "cannot get name";
throw std::runtime_error("cannot get name");
}

std::string get_origin(pugi::xpath_node const &mod)
Expand All @@ -39,7 +39,7 @@ namespace
if (!origin.empty())
return origin.text().get();
}
throw "cannot get origin";
throw std::runtime_error("cannot get origin");
}

std::string get_path_local(pugi::xpath_node const &mod)
Expand All @@ -60,7 +60,7 @@ namespace
return std::string(StringUtils::Split(data_meta, "|").at(1));
}
}
throw "cannot get path";
throw std::runtime_error("cannot get path");
}

std::string get_workshop_id_steam(pugi::xpath_node const &mod)
Expand All @@ -81,7 +81,7 @@ namespace
return std::string(link.substr(link.find('=') + 1));
}
}
throw "cannot get path";
throw std::runtime_error("cannot get path");
}

nlohmann::json mod_to_json(pugi::xpath_node const &mod)
Expand Down
8 changes: 4 additions & 4 deletions src/dayz-linux-launcher/html_preset_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace
if (!data_type.empty())
return child.text().get();
}
throw "cannot get name";
throw std::runtime_error("cannot get name");
}

std::string get_origin(pugi::xpath_node const &mod)
Expand All @@ -39,7 +39,7 @@ namespace
if (!origin.empty())
return origin.text().get();
}
throw "cannot get origin";
throw std::runtime_error("cannot get origin");
}

std::string get_path_local(pugi::xpath_node const &mod)
Expand All @@ -60,7 +60,7 @@ namespace
return std::string(StringUtils::Split(data_meta, "|").at(1));
}
}
throw "cannot get path";
throw std::runtime_error("cannot get path");
}

std::string get_workshop_id_steam(pugi::xpath_node const &mod)
Expand All @@ -81,7 +81,7 @@ namespace
return std::string(link.substr(link.find('=') + 1));
}
}
throw "cannot get path";
throw std::runtime_error("cannot get path");
}

nlohmann::json mod_to_json(pugi::xpath_node const &mod)
Expand Down

0 comments on commit 21a891d

Please sign in to comment.