Skip to content

Commit 1b1bc55

Browse files
improve error reporting for game data verification
1 parent de1820d commit 1b1bc55

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

game/src/legacy/drs.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ struct DrsHdr final {
2626

2727
DRS::DRS(const std::string &path) : in(path, std::ios_base::binary), items() {
2828
ZoneScoped;
29-
in.exceptions(std::ofstream::failbit | std::ofstream::badbit);
29+
try {
30+
in.exceptions(std::ifstream::failbit | std::ifstream::badbit);
31+
} catch (const std::ifstream::failure &ex) {
32+
throw std::runtime_error(std::string("cannot find \"") + path + "\"");
33+
}
3034

3135
DrsHdr hdr{ 0 };
3236
in.read((char*)&hdr, sizeof(hdr));

0 commit comments

Comments
 (0)