diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 9b093ce97..bf023a4c8 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -921,29 +921,31 @@ void segmentation_fault_handler(int sig) switch (sig) { case SIGSEGV: std::cerr << "Illegal storage access..." << std::endl; + throw Base::Exception("Illegal storage access! Please save you work under a new file name and restart the application!"); break; case SIGABRT: std::cerr << "Abnormal program termination..." << std::endl; + throw Base::Exception("Break signal occoured"); break; default: std::cerr << "Unknown error occurred..." << std::endl; break; } -#if defined(__GNUC__) - // According to the documentation to C signals we should exit. - exit(3); -#endif } void unhandled_exception_handler() { std::cerr << "Unhandled exception..." << std::endl; + throw Base::Exception("Unhandled exception"); + } void unexpection_error_handler() { std::cerr << "Unexpected error occurred..." << std::endl; + throw Base::Exception("Unexpected error occurred"); + terminate(); } diff --git a/src/App/FeatureTest.cpp b/src/App/FeatureTest.cpp index 15392cb5e..6621aae20 100644 --- a/src/App/FeatureTest.cpp +++ b/src/App/FeatureTest.cpp @@ -112,13 +112,21 @@ FeatureTest::~FeatureTest() DocumentObjectExecReturn *FeatureTest::execute(void) { + int *i,j; + float f; + void *s; switch(ExceptionType.getValue()) { case 0: break; case 1: throw "Test Exeption"; case 2: throw Base::Exception("FeatureTestException::execute(): Testexception"); + case 3: *i=0;printf("%i",*i);break; // seg-vault + case 4: j=0; printf("%i",1/j); break; // int devision by zero + case 5: f=0.0; printf("%f",1/f); break; // float devision by zero + case 6: s = malloc(3600000000);break; // float devision by zero } + ExecCount.setValue(ExecCount.getValue() + 1); ExecResult.setValue("Exec");