![]() |
Qore Programming Language - C/C++ Library 2.1.1
|
container for holding Qore-language exception information and also for registering a "thread_exit" call More...
#include <ExceptionSink.h>
Public Member Functions | |
| DLLEXPORT | ExceptionSink () |
| creates an empty ExceptionSink object | |
| DLLEXPORT | ~ExceptionSink () |
| calls ExceptionSink::defaultExceptionHandler() on all exceptions still present in the object and then deletes the exception list | |
| DLLEXPORT int | appendLastDescription (const char *fmt,...) |
| appends a formatted string to the top exception description if the desc value is a string | |
| DLLEXPORT void | assimilate (ExceptionSink &xs) |
| assimilates all entries of the "xs" argument by appending them to the internal list and clears the "xs" argument | |
| DLLEXPORT void | assimilate (ExceptionSink *xs) |
| assimilates all entries of the "xs" argument by appending them to the internal list and deletes the "xs" argument | |
| DLLEXPORT void | clear () |
| deletes the exception list immediately | |
| DLLEXPORT const QoreValue | getExceptionArg () |
| returns the argument of the top exception | |
| DLLEXPORT const QoreValue | getExceptionDesc () |
| returns the description of the top exception | |
| DLLEXPORT const QoreValue | getExceptionErr () |
| returns the error of the top exception | |
| DLLEXPORT QoreHashNode * | getExceptionInfo () |
| Consumes the exception and returns an ExceptionInfo hash for it. | |
| DLLEXPORT void | handleExceptions () |
| calls ExceptionSink::defaultExceptionHandler() on all exceptions still present in the object and then deletes the exception list | |
| DLLEXPORT void | handleWarnings () |
| calls ExceptionSink::defaultWarningHandler() on all exceptions still present in the object and then deletes the exception list | |
| DLLEXPORT bool | isEvent () const |
| returns true if at least one exception is present or thread_exit has been triggered | |
| DLLEXPORT bool | isException () const |
| returns true if at least one exception is present | |
| DLLEXPORT bool | isThreadExit () const |
| returns true if thread_exit has been triggered | |
| DLLEXPORT void | markExternallyManaged () |
| Call if the ExceptionSink object will be managed outside of Qore. | |
| DLLEXPORT | operator bool () const |
| returns true if at least one exception is present or thread_exit has been triggered | |
| DLLEXPORT void | outOfMemory () |
| intended to be used to handle out of memory errors | |
| 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 description | |
| DLLEXPORT AbstractQoreNode * | raiseErrnoException (const char *err, int en, QoreStringNode *desc) |
| appends a Qore-language exception to the list and appends the result of strerror(errno) to the description | |
| DLLEXPORT AbstractQoreNode * | raiseException (const char *err, const char *fmt,...) |
| appends a Qore-language exception to the list | |
| DLLEXPORT AbstractQoreNode * | raiseException (const char *err, QoreStringNode *desc) |
| appends a Qore-language exception to the list; takes owenership of the "desc" argument reference | |
| DLLEXPORT void | raiseException (const QoreProgramLocation &loc, const char *err, QoreValue arg, const char *fmt,...) |
| appends a Qore-language exception to the list; takes owenership of the "desc" argument reference | |
| DLLEXPORT void | raiseException (const QoreProgramLocation &loc, const char *err, QoreValue arg, QoreValue desc) |
| appends a Qore-language exception to the list; takes owenership of the "desc" argument reference | |
| DLLEXPORT AbstractQoreNode * | raiseException (QoreStringNode *err, QoreStringNode *desc) |
| appends a Qore-language exception to the list; takes owenership of the "desc" argument reference | |
| DLLEXPORT AbstractQoreNode * | raiseException (QoreStringNode *err, QoreStringNode *desc, QoreValue arg) |
| appends a Qore-language exception to the list; takes owenership of the "desc" argument reference | |
| DLLEXPORT AbstractQoreNode * | raiseExceptionArg (const char *err, QoreValue arg, const char *fmt,...) |
| appends a Qore-language exception to the list, and sets the 'arg' member (this object takes over the reference count of 'arg') | |
| DLLEXPORT AbstractQoreNode * | raiseExceptionArg (const char *err, QoreValue arg, QoreStringNode *desc) |
| appends a Qore-language exception to the list, and sets the 'arg' member (this object takes over the reference counts of 'arg' and 'desc') | |
| DLLEXPORT AbstractQoreNode * | raiseExceptionArg (const char *err, QoreValue arg, QoreStringNode *desc, const QoreCallStack &stack) |
| appends a Qore-language exception to the list, and sets the 'arg' member (this object takes over the reference counts of 'arg' and 'desc') | |
| DLLEXPORT AbstractQoreNode * | raiseExceptionArg (const QoreProgramLocation &loc, const char *err, QoreValue arg, QoreStringNode *desc) |
| appends a Qore-language exception to the list, and sets the 'arg' member (this object takes over the reference counts of 'arg' and 'desc') | |
| DLLEXPORT AbstractQoreNode * | raiseExceptionArg (const QoreProgramLocation &loc, const char *err, QoreValue arg, QoreStringNode *desc, const QoreCallStack &stack) |
| appends a Qore-language exception to the list, and sets the 'arg' member (this object takes over the reference counts of 'arg' and 'desc') | |
| DLLEXPORT void | raiseThreadExit () |
| sets the "thread_exit" flag; will cause the current thread to terminate | |
| DLLEXPORT int | renamePrependLastException (const char *err, const char *desc_fmt,...) |
container for holding Qore-language exception information and also for registering a "thread_exit" call
| DLLEXPORT int ExceptionSink::appendLastDescription | ( | const char * | fmt, |
| ... ) |
appends a formatted string to the top exception description if the desc value is a string
| DLLEXPORT QoreHashNode * ExceptionSink::getExceptionInfo | ( | ) |
Consumes the exception and returns an ExceptionInfo hash for it.
The caller owns the reference returned
| DLLEXPORT ExceptionSink::operator bool | ( | ) | const |
returns true if at least one exception is present or thread_exit has been triggered
Intended as a alternative to isEvent()
| DLLEXPORT void ExceptionSink::outOfMemory | ( | ) |
intended to be used to handle out of memory errors
| DLLEXPORT AbstractQoreNode * ExceptionSink::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 description
The AbstractQoreNode pointer returned is always 0; used to simplify error handling code.
| err | the exception code string |
| en | the error number (normally "errno") |
| fmt | the format string for the description for the exception |
| DLLEXPORT AbstractQoreNode * ExceptionSink::raiseErrnoException | ( | const char * | err, |
| int | en, | ||
| QoreStringNode * | desc ) |
appends a Qore-language exception to the list and appends the result of strerror(errno) to the description
The AbstractQoreNode pointer returned is always 0; used to simplify error handling code.
| err | the exception code string |
| en | the error number (normally "errno") |
| desc | the error description (the ExceptionSink object takes over ownership of the reference count) |
| DLLEXPORT AbstractQoreNode * ExceptionSink::raiseException | ( | const char * | err, |
| const char * | fmt, | ||
| ... ) |
appends a Qore-language exception to the list
The AbstractQoreNode pointer returned is always 0; used to simplify error handling code.
| err | the exception code string |
| fmt | the format string for the description for the exception |
Referenced by OutputStream::check(), StreamBase::check(), InputStream::readHelper(), StreamBase::reassignThread(), and StreamBase::unassignThread().
| DLLEXPORT AbstractQoreNode * ExceptionSink::raiseException | ( | const char * | err, |
| QoreStringNode * | desc ) |
appends a Qore-language exception to the list; takes owenership of the "desc" argument reference
The AbstractQoreNode pointer returned is always 0; used to simplify error handling code.
| err | the exception code string |
| desc | the description string for the exception; the ExceptionSink object takes ownership of the reference count |
| DLLEXPORT void ExceptionSink::raiseException | ( | const QoreProgramLocation & | loc, |
| const char * | err, | ||
| QoreValue | arg, | ||
| const char * | fmt, | ||
| ... ) |
appends a Qore-language exception to the list; takes owenership of the "desc" argument reference
| loc | the source location for the exception |
| err | the exception code string for the exception |
| arg | the 'arg' member of the Qore-language exception object; will be dereferenced when the QoreException object is destroyed |
| fmt | the format string for the description for the exception |
| DLLEXPORT void ExceptionSink::raiseException | ( | const QoreProgramLocation & | loc, |
| const char * | err, | ||
| QoreValue | arg, | ||
| QoreValue | desc ) |
appends a Qore-language exception to the list; takes owenership of the "desc" argument reference
| loc | the source location for the exception |
| err | the exception code string for the exception |
| arg | the 'arg' member of the Qore-language exception object; will be dereferenced when the QoreException object is destroyed |
| desc | the description string for the exception; the ExceptionSink object takes ownership of the reference count |
| DLLEXPORT AbstractQoreNode * ExceptionSink::raiseException | ( | QoreStringNode * | err, |
| QoreStringNode * | desc ) |
appends a Qore-language exception to the list; takes owenership of the "desc" argument reference
The AbstractQoreNode pointer returned is always 0; used to simplify error handling code.
| err | the exception code string for the exception; the ExceptionSink object takes ownership of the reference count |
| desc | the description string for the exception; the ExceptionSink object takes ownership of the reference count |
| DLLEXPORT AbstractQoreNode * ExceptionSink::raiseException | ( | QoreStringNode * | err, |
| QoreStringNode * | desc, | ||
| QoreValue | arg ) |
appends a Qore-language exception to the list; takes owenership of the "desc" argument reference
The AbstractQoreNode pointer returned is always 0; used to simplify error handling code.
| err | the exception code string for the exception; the ExceptionSink object takes ownership of the reference count |
| desc | the description string for the exception; the ExceptionSink object takes ownership of the reference count |
| arg | the exception argument |
| DLLEXPORT AbstractQoreNode * ExceptionSink::raiseExceptionArg | ( | const char * | err, |
| QoreValue | arg, | ||
| const char * | fmt, | ||
| ... ) |
appends a Qore-language exception to the list, and sets the 'arg' member (this object takes over the reference count of 'arg')
The AbstractQoreNode pointer returned is always 0; used to simplify error handling code.
| err | the exception code string |
| arg | the 'arg' member of the Qore-language exception object; will be dereferenced when the QoreException object is destroyed |
| fmt | the format string for the description for the exception |
| DLLEXPORT AbstractQoreNode * ExceptionSink::raiseExceptionArg | ( | const char * | err, |
| QoreValue | arg, | ||
| QoreStringNode * | desc ) |
appends a Qore-language exception to the list, and sets the 'arg' member (this object takes over the reference counts of 'arg' and 'desc')
The AbstractQoreNode pointer returned is always 0; used to simplify error handling code.
| err | the exception code string |
| arg | the 'arg' member of the Qore-language exception object; will be dereferenced when the QoreException object is destroyed |
| desc | the description string for the exception; the ExceptionSink object takes ownership of the reference count |
| DLLEXPORT AbstractQoreNode * ExceptionSink::raiseExceptionArg | ( | const char * | err, |
| QoreValue | arg, | ||
| QoreStringNode * | desc, | ||
| const QoreCallStack & | stack ) |
appends a Qore-language exception to the list, and sets the 'arg' member (this object takes over the reference counts of 'arg' and 'desc')
The AbstractQoreNode pointer returned is always 0; used to simplify error handling code.
| err | the exception code string |
| arg | the 'arg' member of the Qore-language exception object; will be dereferenced when the QoreException object is destroyed |
| desc | the description string for the exception; the ExceptionSink object takes ownership of the reference count |
| stack | a call stack to prepend to the Qore call stack |
| DLLEXPORT AbstractQoreNode * ExceptionSink::raiseExceptionArg | ( | const QoreProgramLocation & | loc, |
| const char * | err, | ||
| QoreValue | arg, | ||
| QoreStringNode * | desc ) |
appends a Qore-language exception to the list, and sets the 'arg' member (this object takes over the reference counts of 'arg' and 'desc')
The AbstractQoreNode pointer returned is always 0; used to simplify error handling code.
| loc | the source location for the exception |
| err | the exception code string |
| arg | the 'arg' member of the Qore-language exception object; will be dereferenced when the QoreException object is destroyed |
| desc | the description string for the exception; the ExceptionSink object takes ownership of the reference count |
| DLLEXPORT AbstractQoreNode * ExceptionSink::raiseExceptionArg | ( | const QoreProgramLocation & | loc, |
| const char * | err, | ||
| QoreValue | arg, | ||
| QoreStringNode * | desc, | ||
| const QoreCallStack & | stack ) |
appends a Qore-language exception to the list, and sets the 'arg' member (this object takes over the reference counts of 'arg' and 'desc')
The AbstractQoreNode pointer returned is always 0; used to simplify error handling code.
| loc | the source location for the exception |
| err | the exception code string |
| arg | the 'arg' member of the Qore-language exception object; will be dereferenced when the QoreException object is destroyed |
| desc | the description string for the exception; the ExceptionSink object takes ownership of the reference count |
| stack | a call stack to prepend to the Qore call stack |
| DLLEXPORT int ExceptionSink::renamePrependLastException | ( | const char * | err, |
| const char * | desc_fmt, | ||
| ... ) |