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 >>
Traceback (most recent call last):
File "exceptionExample.py", line 4, in <module>
hello()
File "exceptionExample.py", line 2, in hello
raise Exception;
Exception
With C++, the information is not that useful:
#include <iostream>
using namespace std;
class Error
{
};
int value()
{
throw Error();
}
int main(int argc, char *argv[]) {
value();
}
>>
terminate called after throwing an instance of 'Error'
Run Command: line 1: 52772 Abort trap: 6 ./"$2" "${@:3}"
How can I make C++ give more detailed information about what module raised an error and from which line?
I'd like to use it without a catch clause.