Skip to content

Commit 9a68db3

Browse files
author
thk123
committed
Added basic version for windows
Due to bug in the VS2013 C++ compiler, rethrow_if_nested is not supported. This implements a basic version for all but the most pathalogical cases (as described http://cplusplus.github.io/LWG/lwg-defects.html#2484)
1 parent e9f03ee commit 9a68db3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/util/unwrap_nested_exception.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,18 @@ std::string unwrap_exception(const std::exception &e, int level)
3535

3636
try
3737
{
38+
#ifndef _MSC_VER
3839
std::rethrow_if_nested(e);
40+
#else
41+
// TODO(tkiley): Required due to bug in MSVC++ Compiler:
42+
// TODO(tkiley): https://blogs.msdn.microsoft.com/vcblog/2016/01/22/vs-2015-update-2s-stl-is-c17-so-far-feature-complete/
43+
const std::nested_exception *exception =
44+
dynamic_cast<const std::nested_exception *>(&e);
45+
if(exception)
46+
{
47+
exception->rethrow_nested();
48+
}
49+
#endif
3950
}
4051
catch(const std::exception &e)
4152
{

0 commit comments

Comments
 (0)