diff options
author | Benoit Foucher <benoit@zeroc.com> | 2008-01-23 11:31:53 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2008-01-23 11:31:53 +0100 |
commit | c7fb26230801e62f3e690a8948d37c33517c4c13 (patch) | |
tree | f17689f60e13fbbd20d12473272a6f0652f39a78 /cpp/src/IceUtil/ThreadException.cpp | |
parent | removing EventHandler in C# (diff) | |
download | ice-c7fb26230801e62f3e690a8948d37c33517c4c13.tar.bz2 ice-c7fb26230801e62f3e690a8948d37c33517c4c13.tar.xz ice-c7fb26230801e62f3e690a8948d37c33517c4c13.zip |
- Added IceUtil::SyscallException and cleaned up few IceUtil exceptions
- Added errorToString() and lastErrorToString() functions to IceUtil/StringUtil.h
- Replaced multiple implementations of errorToString methods with the IceUtil one.
- Fixed bug 2641.
Diffstat (limited to 'cpp/src/IceUtil/ThreadException.cpp')
-rw-r--r-- | cpp/src/IceUtil/ThreadException.cpp | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/cpp/src/IceUtil/ThreadException.cpp b/cpp/src/IceUtil/ThreadException.cpp index 7a17a98185e..c24eae6754c 100644 --- a/cpp/src/IceUtil/ThreadException.cpp +++ b/cpp/src/IceUtil/ThreadException.cpp @@ -12,8 +12,7 @@ using namespace std; IceUtil::ThreadSyscallException::ThreadSyscallException(const char* file, int line, int err ): - Exception(file, line), - _error(err) + SyscallException(file, line, err) { } @@ -25,42 +24,6 @@ IceUtil::ThreadSyscallException::ice_name() const return _name; } -void -IceUtil::ThreadSyscallException::ice_print(ostream& os) const -{ - Exception::ice_print(os); - if(_error != 0) - { - os << ":\nthread syscall exception: "; -#ifdef _WIN32 - LPVOID lpMsgBuf = 0; - DWORD ok = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - _error, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - (LPTSTR)&lpMsgBuf, - 0, - NULL); - - if(ok) - { - LPCTSTR msg = (LPCTSTR)lpMsgBuf; - assert(msg && strlen((char*)msg) > 0); - os << msg; - LocalFree(lpMsgBuf); - } - else - { - os << "unknown thread error"; - } -#else - os << strerror(_error); -#endif - } -} - IceUtil::Exception* IceUtil::ThreadSyscallException::ice_clone() const { @@ -73,13 +36,6 @@ IceUtil::ThreadSyscallException::ice_throw() const throw *this; } -int -IceUtil::ThreadSyscallException::error() const -{ - return _error; -} - - IceUtil::ThreadLockedException::ThreadLockedException(const char* file, int line) : Exception(file, line) { |