diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-12-26 23:16:49 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-12-26 23:16:49 +0000 |
commit | ef165a78bbbb3829f46987077ec1aa2fd6823f2a (patch) | |
tree | 351144a94fa4f295503fc0ef13694d79894c311b /lib/raidfile | |
parent | 0b067dfcbc3bfc4fa1415e5e1e2a69cf1a693653 (diff) |
Improve some exception messages in lib/raidfile.
Use the new macros to ensure that exceptions contain a message and filename,
following the new standard format.
Diffstat (limited to 'lib/raidfile')
-rw-r--r-- | lib/raidfile/RaidFileRead.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/raidfile/RaidFileRead.cpp b/lib/raidfile/RaidFileRead.cpp index 4e7c9567..1e8b380f 100644 --- a/lib/raidfile/RaidFileRead.cpp +++ b/lib/raidfile/RaidFileRead.cpp @@ -1510,7 +1510,10 @@ bool RaidFileRead::DirectoryExists(const RaidFileDiscSet &rSet, const std::strin else { // No. It's a file. Bad! - THROW_EXCEPTION(RaidFileException, UnexpectedFileInDirPlace) + THROW_FILE_ERROR("Expected a directory, " + "found something else", dn, + RaidFileException, + UnexpectedFileInDirPlace); } } else @@ -1519,7 +1522,9 @@ bool RaidFileRead::DirectoryExists(const RaidFileDiscSet &rSet, const std::strin if(errno != ENOENT) { // No. Bad things. - THROW_EXCEPTION(RaidFileException, OSError) + THROW_SYS_FILE_ERROR("Failed to check for " + "existing RaidFile directory", dn, + RaidFileException, OSError); } } } @@ -1621,8 +1626,11 @@ bool RaidFileRead::ReadDirectoryContents(int SetNumber, const std::string &rDirN std::string fullName(dn + DIRECTORY_SEPARATOR + en->d_name); if(EMU_LSTAT(fullName.c_str(), &st) != 0) { - THROW_EXCEPTION(RaidFileException, OSError) + THROW_SYS_FILE_ERROR("Failed to stat", + fullName, RaidFileException, + OSError); } + if(DirReadType == DirReadType_FilesOnly && (st.st_mode & S_IFDIR) == 0) #endif { |