diff options
author | Chris Wilson <chris+github@qwirx.com> | 2009-05-22 20:01:51 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2009-05-22 20:01:51 +0000 |
commit | f62e73c10635b46ece2d4ee618294dc43f175b73 (patch) | |
tree | 9daab4e160398ad3e4081d37d114bd609c1195eb /lib | |
parent | f2eac52d7af3d44f6ebc24fb560b6c1bedfd80fb (diff) |
Log the file name that could not be opened, even for access denied errors.
Diffstat (limited to 'lib')
-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) } } |