Wtx ~ Wt Extension Library
WtxLib
Tips and Tricks for Debugging Wt apps

For one, check out the Exceptions Notification method of hooking the event handler in the main Wt control loop. That little technique goes a long way towards letting you know when bad things happen in your app.

In the event you get a std::exception with no explanation, then what you can do is run your application with gdb, and when you do so, there are a couple of commands you can execute before running the application that will catch a throw and show you what was happening right up before the throw.

The following commands came from this blog post on stack overflow:

https://stackoverflow.com/questions/2443135/how-do-i-find-where-an-exception-was-thrown-in-c

Excerpt from stackoverflow
As you say, we can use 'catch throw' in gdb and call 'backtrace' for every single
thrown exception. While that's usually too tedious to do manually, gdb allows
automation of the process. That allows seeing the backtrace of all exceptions
that are thrown, including the last uncaught one:
gdb>
set pagination off
catch throw
commands
backtrace
continue
end
run
Without further manual intervention, this generates lots of backtraces, including
one for the last uncaught exception:

This little gem is super handy, because you can just let your app run, and when it throws, gdb will immediately spit out a back-trace, and will (probably) take you straight to the offender.