SoError(3)

πŸ“¦ version 2.5.0, in fedora 43, fedora 44

πŸŽ€ NAME πŸŽ€

okay so this is SoError(3) from the Library Functions Manual, and she is the moment: SoError β€” the base class for all the error handling classes. she's the blueprint, the mother of the whole error-handling friend group. periodt. πŸ’–


✨ SYNOPSIS ✨

#include <Inventor/errors/SoError.h>

Inherited by SoDebugError, SoMemoryError, and SoReadError. bestie has children and they're all iconic in their own way πŸ¦‹

πŸ‘‘ Public Member Functions

virtual ~SoError ()
const SbString & getDebugString (void) const
virtual SoType getTypeId (void) const
SbBool isOfType (const SoType type) const

🌟 Static Public Member Functions

static void setHandlerCallback (SoErrorCB *const func, void *const data)
static SoErrorCB * getHandlerCallback (void)
static void * getHandlerData (void)
static SoType getClassTypeId (void)
static void post (const char *const format,...)
static SbString getString (const SoNode *const node)
static SbString getString (const SoPath *const path)
static SbString getString (const SoEngine *const engine)
static void initClass (void)
static void initClasses (void)

🫢 Protected Member Functions

virtual SoErrorCBPtr getHandler (void *&data) const
void setDebugString (const char *const str)
void appendToDebugString (const char *const str)
void handleError (void)

πŸ’… Static Protected Member Functions

static void defaultHandlerCB (const SoError *error, void *userdata)

🌈 Detailed Description 🌈

The SoError class is the base class for all the error handling classes. like, every single one of them traces back to her. main character energy fr fr πŸ’œ

The default error handler just prints messages on the standard error output channel, but this can be overridden by client applications. so out of the box she's like "okay we're printing to stderr, that's the vibe" β€” but you can swap that out. no cap.

Being able to override the default handler is useful when you want to collect error messages upon e.g. model import for later presentation of the messages to the user in any custom manner (like for instance in a GUI messagebox). lowkey the whole point: catch the errors, hold onto them, and show them to your user however you want. a little popup, a fancy box, whatever slays. ✨

The SoError class is not designed to be particularly useful for "direct use". Within the Coin library it is only used through its subclasses. okay so real talk β€” do not try to use her directly, she's the abstract parent, the subclasses are the ones doing the actual work. it's giving "supportive mom at the recital" energy. πŸŽ€


🧚 Constructor & Destructor Documentation 🧚

virtual SoError::~SoError () [inline], [virtual]

The default destructor does nothing. literally nothing. she leaves the party with zero drama. πŸ’€


πŸ”₯ Member Function Documentation πŸ”₯

void SoError::setHandlerCallback (SoErrorCB const *function, void const *data) [static]

This method sets the error handler callback for messages posted via this class. 🫢

⚠️ Note that this will not override the error/debug message handler for subclasses β€” these will have to be overrided by calling the subclass' setHandlerCallback() method. so if you're trying to redirect the subclass messages, you gotta go knock on the subclass's door directly. no shortcuts, bestie. 😭

See also: defaultHandlerCB()

References defaultHandlerCB().


SoErrorCB * SoError::getHandlerCallback (void) [static]

Returns the error handler callback for messages posted via this class. it's the getter to the setter, the other half of the pair πŸ’ž


void * SoError::getHandlerData (void) [static]

This method returns the pointer used for passing data back to the callback handler method. she hands you back your own lil data pointer, as a treat. 🌸


const SbString & SoError::getDebugString (void) const

This method returns an SbString containing error info from the given error instance. all the tea, in string form. ⭐


SoType SoError::getClassTypeId (void) [static]

This static method returns the SoType for this class. class-level type id, static girlies stay winning πŸ‘‘

See also: getTypeId()


SoType SoError::getTypeId (void) const [virtual]

This method returns the SoType of a particular object instance. this one's about the specific instance, not the class, iykyk πŸ’…

See also: getClassTypeId()

Reimplemented in SoDebugError, SoMemoryError, and SoReadError.

Referenced by isOfType().


SbBool SoError::isOfType (const SoType type) const

This method returns TRUE if the error instance is of β€” or derived from β€” type, and FALSE otherwise. vibe check for types 🌈

References getTypeId(), and SoType::isDerivedFrom().


void SoError::post (const char const *format, ...) [static]

This method posts an error message. The format string and the trailing aguments (yes, that spelling is straight from the source, not mine πŸ’€) should follow the printf() standard.


SbString SoError::getString (const SoNode const *node) [static]

Constructs a string identifying the node with name (if available) and memory pointer. name + pointer, that's the whole recipe πŸŽ€


SbString SoError::getString (const SoPath const *path) [static]

Constructs a string identifying the path with name (if available) and memory pointer. same energy, different class πŸ¦‹


SbString SoError::getString (const SoEngine const *engine) [static]

Constructs a string identifying the engine with name (if available) and memory pointer. third one, still iconic 🌟


void SoError::initClass (void) [static]

This method takes care of initializing all static data for the class. she's setting up the whole static situation so everything else can function. 🫢

References SoType::badType(), SoType::createType(), and defaultHandlerCB().

Referenced by initClasses().


void SoError::initClasses (void) [static]

This static method initializes all the SoError classes. not just one β€” the whole fam. ✨

References initClass().

Referenced by SoDB::init().


void SoError::defaultHandlerCB (const SoError error, void data) [static], [protected]

Contains the default code for handling error strings.

Default treatment of an error message is to print it out on the standard error file handle. plain and simple, straight to stderr, no filter. πŸ’…

Referenced by initClass(), SoReadError::post(), and setHandlerCallback().


SoErrorCB * SoError::getHandler (void &data*) const [protected], [virtual]

This is just a convenience wrapper around the getHandlerCallback() and getHandlerData() methods. she's the two-in-one combo meal πŸ“

Reimplemented in SoDebugError, SoMemoryError, and SoReadError.


void SoError::setDebugString (const char const *str) [protected]

Replace the latest stored debug string with str. out with the old, in with the new πŸ’–

Referenced by SoMemoryError::post(), and SoReadError::post().


void SoError::appendToDebugString (const char const *str) [protected]

Add str at the end of the currently stored debug string. not replace β€” append. she's adding to the collection, not clearing the shelf πŸŽ€

Referenced by SoMemoryError::post(), and SoReadError::post().


void SoError::handleError (void) [protected]

This method calls the appropriate handler for an error instance. All error handling goes through this method, and is therefore a good candidate for a debugger breakpoint. so like, if you ever wanna catch errors mid-flight in a debugger β€” this is THE spot. set your breakpoint here, bestie, it's literally the choke point. πŸ”₯

References SoType::badType().

Referenced by SoMemoryError::post(), and SoReadError::post().


πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for Coin from the source code. (she didn't write herself, she was generated, and honestly? still ate. πŸ’…)


and that's the whole page, bestie!! πŸŽ€ so this was SoError(3), from the Library Functions Manual, brought to you by Coin, Version 2.5.0 β€” thanks for reading, mwah, go set some error handlers responsibly πŸ«Άβœ¨πŸ’–

πŸ“¦ where this page comes from