32 #ifndef _QORE_EXCEPTIONSINK_H
34 #define _QORE_EXCEPTIONSINK_H
40 struct QoreProgramLocation;
44 friend struct qore_es_private;
48 struct qore_es_private *priv;
54 DLLLOCAL ExceptionSink& operator=(
const ExceptionSink&);
85 DLLEXPORT
operator bool ()
const;
152 DLLEXPORT
void clear();
158 DLLLOCAL QoreException* catchException();
159 DLLLOCAL
void overrideLocation(
const QoreProgramLocation& loc);
160 DLLLOCAL
void rethrow(QoreException* old);
162 DLLLOCAL
static void defaultExceptionHandler(QoreException* e);
163 DLLLOCAL
static void defaultWarningHandler(QoreException* e);
166 static inline void alreadyDeleted(
ExceptionSink *xsink,
const char *cmeth) {
167 xsink->
raiseException(
"OBJECT-ALREADY-DELETED",
"the method %s() cannot be executed because the object has already been deleted", cmeth);
170 static inline void makeAccessDeletedObjectException(
ExceptionSink *xsink,
const char *mem,
const char *cname) {
171 xsink->
raiseException(
"OBJECT-ALREADY-DELETED",
"attempt to access member '%s' of an already-deleted object of class '%s'", mem, cname);
174 static inline void makeAccessDeletedObjectException(
ExceptionSink *xsink,
const char *cname) {
175 xsink->
raiseException(
"OBJECT-ALREADY-DELETED",
"attempt to access an already-deleted object of class '%s'", cname);
DLLEXPORT void handleWarnings()
calls ExceptionSink::defaultWarningHandler() on all exceptions still present in the object and then d...
DLLEXPORT void outOfMemory()
intended to be used to handle out of memory errors FIXME: not yet fully implemented ...
DLLEXPORT ~ExceptionSink()
calls ExceptionSink::defaultExceptionHandler() on all exceptions still present in the object and then...
DLLEXPORT void handleExceptions()
calls ExceptionSink::defaultExceptionHandler() on all exceptions still present in the object and then...
DLLEXPORT bool isEvent() const
returns true if at least one exception is present or thread_exit has been triggered ...
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:55
DLLEXPORT AbstractQoreNode * raiseException(const char *err, const char *fmt,...)
appends a Qore-language exception to the list
DLLEXPORT AbstractQoreNode * raiseErrnoException(const char *err, int en, const char *fmt,...)
appends a Qore-language exception to the list and appends the result of strerror(errno) to the descri...
Qore's string value type, reference counted, dynamically-allocated only.
Definition: QoreStringNode.h:48
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
DLLEXPORT bool isThreadExit() const
returns true if thread_exit has been triggered
DLLEXPORT AbstractQoreNode * raiseExceptionArg(const char *err, AbstractQoreNode *arg, const char *fmt,...)
appends a Qore-language exception to the list, and sets the 'arg' member (this object takes over the ...
DLLEXPORT void clear()
deletes the exception list immediately
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:43
DLLEXPORT void raiseThreadExit()
sets the "thread_exit" flag; will cause the current thread to terminate
DLLEXPORT ExceptionSink()
creates an empty ExceptionSink object
DLLEXPORT void assimilate(ExceptionSink *xs)
assimilates all entries of the "xs" argument by appending them to the internal list and deletes the "...
DLLEXPORT bool isException() const
returns true if at least one exception is present