This class is the base class of all errors returned by JCore functions.
Every class or utility function defines whatever special error classes
it needs and then returns type JError.
Note that derived classes cannot store -any- extra information.
Consider the following code:
JError foo()
{
return JUnknownError();
}
If this looks scary to you, you understand C++. If you understand
why this compiles, you grok C++. What happens is that an object of
type JUnknownError is created and then the JError copy constructor
is called to construct a JError object from the JUnknownError object.
This new JError object is returned and the JUnknownError object is
deleted. (Just another reason why most JCore objects don't have
copy constructors.)
Since every JError message stores a descriptive message, one often only
needs to check if the return value is kJNoError. If it isn't, then pass
the object's long message to JStringManager::ReportError() or
JUserNotification::ReportError().
Since the type must be unique for every JError, the descriptive message
can be stored in JStringManager. This is automatic when the message
passed to the constructor is nullptr.
Refer to the documentation for JRTTIBase for the recommended way to
define type strings.