TfError Class Reference

Represents an object that contains error information. More...

+ Inheritance diagram for TfError:

Public Member Functions

TfEnum GetErrorCode () const
 Return the error code posted. More...
 
const std::string & GetErrorCodeAsString () const
 Return the diagnostic code posted as a string. More...
 
- Public Member Functions inherited from TfDiagnosticBase
const TfCallContext & GetContext () const
 Return the call context where the message was issued. More...
 
std::string GetSourceFileName () const
 Return the source file name that the diagnostic message was posted from. More...
 
size_t GetSourceLineNumber () const
 Return the source line number that the diagnostic message was posted from. More...
 
std::string const & GetCommentary () const
 Return the commentary string describing this diagnostic message. More...
 
std::string GetSourceFunction () const
 Return the source function that the diagnostic message was posted from. More...
 
void AugmentCommentary (const std::string &s)
 Add to the commentary string describing this diagnostic message. More...
 
TfEnum GetDiagnosticCode () const
 Return the diagnostic code posted. More...
 
const std::string & GetDiagnosticCodeAsString () const
 Return the diagnostic code posted as a string. More...
 
template<typename T >
const T * GetInfo () const
 Return a (possibly NULL) const pointer to the info object associated with this message. More...
 
void SetInfo (TfDiagnosticInfo any)
 Set the info object associated with this diagnostic message. More...
 
bool GetQuiet () const
 Return true if the message was posted via PostQuietly(). More...
 
std::string GetPrettyPrintString () const
 Return the commentary string. More...
 
bool IsFatal () const
 Return true if this diagnostic's code is a fatal code. More...
 
bool IsCodingError () const
 Return true if this diagnostic's code is either a fatal or nonfatal coding error. More...
 
 TfDiagnosticBase (TfEnum code, char const *codeString, TfCallContext const &context, const std::string &commentary, TfDiagnosticInfo info, bool quiet)
 Construct an instance. More...
 

Friends

class TfDiagnosticMgr
 

Additional Inherited Members

- Protected Attributes inherited from TfDiagnosticBase
TfCallContext _context
 
std::string _commentary
 
TfEnum _code
 
std::string _codeString
 
TfDiagnosticInfo _info
 
size_t _serial = 0
 
bool _quiet = false
 

Detailed Description

Represents an object that contains error information.

See Guide To Diagnostic Facilities in the C++ API reference for a detailed description of the error issuing API. For a example of how to post an error, see TF_ERROR(), also in the C++ API reference.

In the Python API, you can raise several different types of errors, including coding errors (Tf.RaiseCodingError), run time errors (Tf.RaiseRuntimeError), fatal errors (Tf.Fatal).

Definition at line 49 of file error.h.

Member Function Documentation

◆ GetErrorCode()

TfEnum GetErrorCode ( ) const
inline

Return the error code posted.

Definition at line 53 of file error.h.

◆ GetErrorCodeAsString()

const std::string& GetErrorCodeAsString ( ) const
inline

Return the diagnostic code posted as a string.

Definition at line 58 of file error.h.


The documentation for this class was generated from the following file: