InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IErrorState Class Referenceabstract

#include <IErrorState.h>

Inheritance diagram for IErrorState:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IERRORSTATE }
 

Public Member Functions

virtual void Set (ErrorCode errCode, const PMString *errStr=nil, IPMUnknown *errInfo=nil, const PMString *errContext=nil)=0
 
virtual ErrorCode GetErrorCode () const =0
 
virtual PMString GetErrorString () const =0
 
virtual IPMUnknownQueryErrorInfo () const =0
 
virtual PMString GetContextInfo () const =0
 
virtual bool16 IsExplicitString () const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Interface that stores the global error state, and hangs off the session (kSessionBoss); use the methods in ErrorUtils rather than this interface to manipulate the global error state.

The application maintains a global error state associated with the session. When an error happens, the error should be posted to the global error state via IErrorState, and the error returned by the function.

Usually you don't access this directly: ErrorUtils is a handy shell over this function.

See Also
ErrorUtils
kSessionBoss

Member Function Documentation

virtual PMString IErrorState::GetContextInfo () const
pure virtual

Return the context info. Typically this is empty, except in Macintosh Debug where it may contain a stack trace of the location that set the error code.

virtual ErrorCode IErrorState::GetErrorCode () const
pure virtual

Get the current error code

Returns
the error code
virtual PMString IErrorState::GetErrorString () const
pure virtual

Return the current error string. Attempts to resolve it via the error registry if the string was not set explicitly.

virtual bool16 IErrorState::IsExplicitString () const
pure virtual

Returns kTrue if the error string was set explicitly in the call to Set.

virtual IPMUnknown* IErrorState::QueryErrorInfo () const
pure virtual

Return the error info object, (errInfo passed into Set). Client must release it when done with it.

virtual void IErrorState::Set (ErrorCode errCode,
const PMStringerrStr = nil,
IPMUnknownerrInfo = nil,
const PMStringerrContext = nil 
)
pure virtual

Sets the current error code to errCode. If no string is passed in the error state will find a string based on the code (see IErrorCodeService). Set platformErr to true if the error code is from the platform. errInfo can be an error specific object that contains more information about the error. The object only means something to the originator of the error and the handler of the error. For instance, suppose the error is "file %s not found", where you want s to be filled in with the filename. It could be that associated with the file not found error is an object containing the filename. SetErrorCode AddRefs on errInfo and makes a copy of the string pointed to be errStr.