24 #ifndef _QORE_EXCEPTIONSINK_H
26 #define _QORE_EXCEPTIONSINK_H
32 struct QoreProgramLocation;
36 friend struct qore_es_private;
40 struct qore_es_private *priv;
46 DLLLOCAL ExceptionSink& operator=(
const ExceptionSink&);
77 DLLEXPORT
operator bool ()
const;
144 DLLEXPORT
void clear();
150 DLLLOCAL QoreException* catchException();
151 DLLLOCAL
void overrideLocation(
const QoreProgramLocation& loc);
152 DLLLOCAL
void rethrow(QoreException* old);
154 DLLLOCAL
static void defaultExceptionHandler(QoreException* e);
155 DLLLOCAL
static void defaultWarningHandler(QoreException* e);
158 static inline void alreadyDeleted(
ExceptionSink *xsink,
const char *cmeth) {
159 xsink->
raiseException(
"OBJECT-ALREADY-DELETED",
"the method %s() cannot be executed because the object has already been deleted", cmeth);
162 static inline void makeAccessDeletedObjectException(
ExceptionSink *xsink,
const char *mem,
const char *cname) {
163 xsink->
raiseException(
"OBJECT-ALREADY-DELETED",
"attempt to access member '%s' of an already-deleted object of class '%s'", mem, cname);
166 static inline void makeAccessDeletedObjectException(
ExceptionSink *xsink,
const char *cname) {
167 xsink->
raiseException(
"OBJECT-ALREADY-DELETED",
"attempt to access an already-deleted object of class '%s'", cname);