diff options
author | Bernard Normier <bernard@zeroc.com> | 2014-10-29 20:38:19 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2014-10-29 20:38:19 +0000 |
commit | f29afb0ca26a0d4964a19d8fd5104cf5f0db81a3 (patch) | |
tree | e6a10ffa1f36d5d0726ff69bd6a91260e21d0259 /cpp/src/Ice/LoggerUtil.cpp | |
parent | Fixed (ICE-5800) - Slice build dependencies don't work properly in source tree (diff) | |
download | ice-f29afb0ca26a0d4964a19d8fd5104cf5f0db81a3.tar.bz2 ice-f29afb0ca26a0d4964a19d8fd5104cf5f0db81a3.tar.xz ice-f29afb0ca26a0d4964a19d8fd5104cf5f0db81a3.zip |
Fixed ICE-5796: LoggerUtil now deals properly with exceptions (print their stack traces when available)
Diffstat (limited to 'cpp/src/Ice/LoggerUtil.cpp')
-rw-r--r-- | cpp/src/Ice/LoggerUtil.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cpp/src/Ice/LoggerUtil.cpp b/cpp/src/Ice/LoggerUtil.cpp index 9f1e85accb4..00b79a6845c 100644 --- a/cpp/src/Ice/LoggerUtil.cpp +++ b/cpp/src/Ice/LoggerUtil.cpp @@ -43,18 +43,16 @@ Ice::operator<<(Ice::LoggerOutputBase& out, ios_base& (*val)(ios_base&)) } Ice::LoggerOutputBase& -Ice::operator<<(Ice::LoggerOutputBase& out, const std::exception& ex) +Ice::loggerInsert(Ice::LoggerOutputBase& out, const IceUtil::Exception& ex) { if(IceUtilInternal::printStackTraces) { - const ::IceUtil::Exception* exception = dynamic_cast<const ::IceUtil::Exception*>(&ex); - if(exception) - { - out.__str() << exception->what() << '\n' << exception->ice_stackTrace(); - return out; - } + out.__str() << ex.what() << '\n' << ex.ice_stackTrace(); + } + else + { + out.__str() << ex.what(); } - out.__str() << ex.what(); return out; } |