Error Methods

Web Site  Methods

 
Str::Error
 
void Error (StrEC ecode)

The library will call this method internally if an error detectable both in debug and release builds occurs. The default behavior of the method is to throw an exception using the StrException class, but this may be customized (see "Str Library Exceptions")

See str.h for a definition of the possible values for the error code. (Lookup the StrEC enumerated type)

Your code typically should not allow situations that cause Str Library errors to occur. However, if for some reason you need to programatically react to the exception, use code like the following:

	try {
	   // Do something that may cause Error() to be called here
	}
	catch (StrException e) {
	   // Do something with e.m_Object and e.m_Error here
	}

 

 
Str::ErrorNoObject
 
static void ErrorNoObject (StrEC ecode)

The library will call this method internally if an error occurs. The major difference from Error is that ErrorNoObject is static, and the m_Object field of the thrown StrException object will typically be an empty string.

 

See also: Str Library Exceptions, Customizing Error Handling, Str Conditional Defines