So my c++ program just crashed, and the error I got was:

```
terminate called after throwing an instance of 'std::length_error'
  what():  basic_string::_S_create
Aborted

```

Now, what I've added recently to my code is a SIGSEGV handler, so if it was a segmentation fault, it would proceed to print the stack trace.

How do I go about making an exit handler for uncaught (or more like uncatchable) exceptions in c++?