summaryrefslogtreecommitdiff
path: root/lib/common/FileStream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common/FileStream.cpp')
-rw-r--r--lib/common/FileStream.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/lib/common/FileStream.cpp b/lib/common/FileStream.cpp
index 99b66666..e38e5d38 100644
--- a/lib/common/FileStream.cpp
+++ b/lib/common/FileStream.cpp
@@ -67,24 +67,29 @@ void FileStream::AfterOpen()
{
MEMLEAKFINDER_NOT_A_LEAK(this);
- #ifdef WIN32
- BOX_LOG_WIN_WARNING_NUMBER("Failed to open file: " <<
- mFileName, winerrno);
- #else
- BOX_LOG_SYS_WARNING("Failed to open file: " <<
- mFileName);
- #endif
-
+#ifdef WIN32
+ if(errno == EACCES)
+ {
+ THROW_WIN_FILE_ERROR("Failed to open file", mFileName,
+ CommonException, AccessDenied);
+ }
+ else
+ {
+ THROW_WIN_FILE_ERROR("Failed to open file", mFileName,
+ CommonException, OSFileOpenError);
+ }
+#else
if(errno == EACCES)
{
- THROW_EXCEPTION_MESSAGE(CommonException, AccessDenied,
- mFileName);
+ THROW_SYS_FILE_ERROR("Failed to open file", mFileName,
+ CommonException, AccessDenied);
}
else
{
- THROW_EXCEPTION_MESSAGE(CommonException, OSFileOpenError,
- mFileName);
+ THROW_SYS_FILE_ERROR("Failed to open file", mFileName,
+ CommonException, OSFileOpenError);
}
+#endif
}
}