From 34d2c33c1848ce3a772df116af750fa3c68df4fe Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 6 Sep 2013 23:37:21 +0200 Subject: [PATCH] Handle the default interpreter's runtime exception. --- include/cling/Interpreter/RuntimeExceptions.h | 1 + lib/UserInterface/UserInterface.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/cling/Interpreter/RuntimeExceptions.h b/include/cling/Interpreter/RuntimeExceptions.h index 0d0a9788..14737694 100644 --- a/include/cling/Interpreter/RuntimeExceptions.h +++ b/include/cling/Interpreter/RuntimeExceptions.h @@ -16,6 +16,7 @@ namespace cling { ///\brief Base class for all interpreter exceptions. /// class InterpreterException { + public: virtual void what() throw(); }; diff --git a/lib/UserInterface/UserInterface.cpp b/lib/UserInterface/UserInterface.cpp index 403e8641..69bb31a2 100644 --- a/lib/UserInterface/UserInterface.cpp +++ b/lib/UserInterface/UserInterface.cpp @@ -91,6 +91,10 @@ namespace cling { } catch(runtime::NullDerefException& e) { + llvm::errs() << "Exception was thrown at runtime. Recovering...\n"; + e.what(); + } + catch(runtime::InterpreterException& e) { // The diagnostic goes here: e.what(); }