diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IceUtil/Exception.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/cpp/src/IceUtil/Exception.cpp b/cpp/src/IceUtil/Exception.cpp index 5208bfe0a2d..91b33d515ae 100644 --- a/cpp/src/IceUtil/Exception.cpp +++ b/cpp/src/IceUtil/Exception.cpp @@ -57,16 +57,23 @@ IceUtil::Exception::ice_print(ostream& out) const const char* IceUtil::Exception::what() const throw() { - StaticMutex::Lock lock(globalMutex); + try { - if(_str.empty()) + StaticMutex::Lock lock(globalMutex); { - stringstream s; - ice_print(s); - _str = s.str(); // Lazy initialization. + if(_str.empty()) + { + stringstream s; + ice_print(s); + _str = s.str(); // Lazy initialization. + } } + return _str.c_str(); } - return _str.c_str(); + catch(...) + { + } + return ""; } IceUtil::Exception* |