Linked Questions
                        19 questions linked to/from Why doesn't C++ use std::nested_exception to allow throwing from destructor?
                    
                
            
            
                485
            
            votes
        
        
            
                16
            
            answers
        
        
            
                117k
            
            views
        
        
            
            
            
        Why should I not wrap every block in "try"-"catch"?
                    I have always been of the belief that if a method can throw an exception then it is reckless not to protect this call with a meaningful try block.
I just posted 'You should ALWAYS wrap calls that can ...
                
            
       
        
            
                287
            
            votes
        
        
            
                16
            
            answers
        
        
            
                378k
            
            views
        
        
            
            
            
        How to display a stack trace when an exception is thrown
                    I want to have a way to report the stack trace to the user if an exception is thrown. What is the best way to do this?
I'd like it to be portable if possible. I want information to pop up, so the user ...
                
            
       
        
            
                408
            
            votes
        
        
            
                6
            
            answers
        
        
            
                722k
            
            views
        
        
            
            
        How to throw a C++ exception
                    I have a very poor understanding of exception handling(i.e., how to customize throw, try, catch statements for my own purposes).
For example, I have defined a function as follows: int compare(int a, ...
                
            
       
        
            
                109
            
            votes
        
        
            
                14
            
            answers
        
        
            
                39k
            
            views
        
        
            
            
        Should I inherit from std::exception?
                    I've seen at least one reliable source (a C++ class I took) recommend that application-specific exception classes in C++ should inherit from std::exception. I'm not clear on the benefits of this ...
                
            
       
        
            
                144
            
            votes
        
        
            
                5
            
            answers
        
        
            
                93k
            
            views
        
        
            
            
            
        C++ Exceptions questions on rethrow of original exception
                    Will the following append() in the catch cause the rethrown exception to see the effect of append() being called?
try {
  mayThrowMyErr();
} catch (myErr &err) {
  err.append("Add to my message ...
                
            
       
        
            
                85
            
            votes
        
        
            
                7
            
            answers
        
        
            
                189k
            
            views
        
        
            
            
            
        c++ exception : throwing std::string
                    I would like to throw an exception when my C++ methods encounter something weird and can't recover. Is it OK to throw a std::string pointer?
Here's what I was looking forward to doing:
void Foo::Bar(...
                
            
       
        
            
                34
            
            votes
        
        
            
                10
            
            answers
        
        
            
                30k
            
            views
        
        
            
            
        Call-stack for exceptions in C++
                    Today, in my C++ multi-platform code, I have a try-catch around every function. In every catch block I add the current function's name to the exception and throw it again, so that in the upmost catch ...
                
            
       
        
            
                42
            
            votes
        
        
            
                6
            
            answers
        
        
            
                35k
            
            views
        
        
            
            
        C++ exception class design [closed]
                    What is a good design for a set of exception classes?
I see all sorts of stuff around about what exception classes should and shouldn't do, but not a simple design which is easy to use and extend ...
                
            
       
        
            
                13
            
            votes
        
        
            
                14
            
            answers
        
        
            
                8k
            
            views
        
        
            
            
        Finding out the source of an exception in C++ after it is caught?
                    I'm looking for an answer in MS VC++.
When debugging a large C++ application, which unfortunately has a very extensive usage of C++ exceptions. Sometimes I catch an exception a little later than I ...
                
            
       
        
            
                13
            
            votes
        
        
            
                5
            
            answers
        
        
            
                21k
            
            views
        
        
            
            
            
        how to get error line number in C++ program
                    I want to handle errors in my c++ program, so I created some exception classes to manage those errors, but I want to specify at which line in my program the error occurred.
I passed LINE macro to the ...
                
            
       
        
            
                13
            
            votes
        
        
            
                4
            
            answers
        
        
            
                2k
            
            views
        
        
            
            
            
        Should exceptions be chained in C++? [duplicate]
                    I just finished work on a C++-program where I've implemented my own exceptions (although derived from std::exception). The practice I've applied when one exception causes a chain reaction, propagating ...
                
            
       
        
            
                1
            
            vote
        
        
            
                3
            
            answers
        
        
            
                2k
            
            views
        
        
            
            
            
        rethrow exception preserving backtrace
                    I need to catch some "fatal" C++ exception, then flush logs and rethrow the former, with its own backtrace.
My current solution, however, displays (correctly) the wrong stacktrace.
#include &...
                
            
       
        
            
                2
            
            votes
        
        
            
                2
            
            answers
        
        
            
                5k
            
            views
        
        
            
        C++ simple crash logging
                    I'm writing a plugin (basically a dll) for a 3D application and occasionally there are crashes. Sometimes these are very difficult to find and I wanted to invest some time into making (or integrating ...
                
            
       
        
            
                2
            
            votes
        
        
            
                5
            
            answers
        
        
            
                4k
            
            views
        
        
            
            
            
        Stack trace after catching exception
                    I would like too see the stacktrace after the exception is thrown of course using debugger. Normally, when the exception is never caught, the debugger stops the program after receiving SIGABRT and I ...
                
            
       
        
            
                4
            
            votes
        
        
            
                4
            
            answers
        
        
            
                1k
            
            views
        
        
            
            
            
        How to make C++ give detailed exception information just like python does?
                    With python, when an exception occurs, I get detailed information about what file raised an error, even without a catch:
def hello():
    raise Exception;
hello() 
Execution result >>
...