SOERROR(3iv)
β¨ SoError β error handling base class β¨
okay bestie, welcome to the <pink>SoError(3IV)</pink> glow-up π this is the manual page for the error handling base class, and yes we are going to read the whole thing together, no skimming, no scrolling past the boring bits, because every single flag and fact is staying right here π«Ά
πΈ NAME πΈ
SoError β error handling base class π
π¦ INHERITS FROM π¦
SoError
not me pointing out that the page says it inherits from itself π we do not make the rules, we just report them, periodt.
π SYNOPSIS π
#include <Inventor/errors/SoError.h>
typedef void SoErrorCB(const SoError *error, void *data)
Methods from class SoError:
static void setHandlerCallback(SoErrorCB *cb, void *data)
static SoErrorCB * getHandlerCallback()
static void * getHandlerData()
const SbString & getDebugString() const
static SoType getClassTypeId()
virtual SoType getTypeId() const
SbBool isOfType(SoType type) const
π DESCRIPTION π
okay so. SoError is the base class for all error classes, and those classes are the ones that handle error handling for applications. there are literally two facets to errors: posting and handling β¨
an error gets posted when some bad condition occurs π and posting is done primarily by the Inventor library itself, but extenders can post their own errors too, slay. posting an error creates an instance of the appropriate error class (or subclass) and then passes it to the active error handler. the default handler just prints an appropriate message to stderr β that's it, that's the whole vibe. applications can override this behavior by supplying a different handler, which you do by specifying a callback function π
every subclass of SoError supports the setHandlerCallback() method, and that's the one you use to set the callback function that handles errors. here's the tea though: the callback function for a specific error class is always used in preference to that of any base classes when handling errors π«Ά
and now the important warning bestie, listen up: the error instance passed to a callback is deleted immediately after the callback is called π so if your application wants to save information from that instance, it has to copy it out first. no holding onto it. it's giving "blink and you'll miss it."
each error class contains a run-time class type id (SoType) that can be used to determine the type of an instance β¨ the base class defines a character string that represents a detailed error message that is printed by the default handler. and all handlers are called by the SoError::handleError() method π so when you're debugging, you can set a breakpoint on this method to stop right before an error is handled β that's your main character debugging moment, iykyk.
π METHODS π
static void setHandlerCallback(SoErrorCB *cb, void *data)β sets the handler callback for theSoErrorclass. πstatic SoErrorCB * getHandlerCallback()β returns the handler callback for theSoErrorclass. πstatic void * getHandlerData()β returns the handler data for theSoErrorclass. πconst SbString & getDebugString() constβ returns the debug string containing full error information from the instance. like, the whole lore. πstatic SoType getClassTypeId()β returns the type identifier for theSoErrorclass. βvirtual SoType getTypeId() constβ returns the type identifier for the error instance. βSbBool isOfType(SoType type) constβ returnsTRUEif the instance is of the given type or is derived from it. π
π SEE ALSO π
SoDebugError, SoMemoryError, SoReadError β go read those next bestie, they're the whole friend group π«Ά
and that's the page!! πΈ this was the SoError(3IV) manual, footer and all, so consider yourself fully caught up, no cap π bye bestie, go handle those errors responsibly β¨π¦π
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms