diff options
-rw-r--r-- | lib/common/FileStream.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/common/FileStream.cpp b/lib/common/FileStream.cpp index d6a3c5da..5be8237c 100644 --- a/lib/common/FileStream.cpp +++ b/lib/common/FileStream.cpp @@ -67,19 +67,20 @@ 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 + if(errno == EACCES) { THROW_EXCEPTION(CommonException, AccessDenied) } else { - #ifdef WIN32 - BOX_LOG_WIN_WARNING_NUMBER("Failed to open file: " << - mFileName, winerrno); - #else - BOX_LOG_SYS_WARNING("Failed to open file: " << - mFileName); - #endif THROW_EXCEPTION(CommonException, OSFileOpenError) } } |