We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de1820d commit 1b1bc55Copy full SHA for 1b1bc55
game/src/legacy/drs.cpp
@@ -26,7 +26,11 @@ struct DrsHdr final {
26
27
DRS::DRS(const std::string &path) : in(path, std::ios_base::binary), items() {
28
ZoneScoped;
29
- in.exceptions(std::ofstream::failbit | std::ofstream::badbit);
+ 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
+ }
34
35
DrsHdr hdr{ 0 };
36
in.read((char*)&hdr, sizeof(hdr));
0 commit comments