Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions
Standard_Failure Class Reference

Forms the root of the entire exception hierarchy. Inherits from std::exception and implements what() interface. More...

#include <Standard_Failure.hxx>

Inheritance diagram for Standard_Failure:
Inheritance graph
[legend]

Public Member Functions

 Standard_Failure ()
 Creates a status object of type "Failure".
 
 Standard_Failure (const Standard_Failure &theOther)
 Copy constructor.
 
 Standard_Failure (const char *theMessage)
 Creates a status object of type "Failure" with message.
 
 Standard_Failure (const char *const theMessage, const char *const theStackTrace)
 Creates a status object of type "Failure" with message and stack trace.
 
Standard_Failureoperator= (const Standard_Failure &theOther)
 Assignment operator.
 
 ~Standard_Failure () override
 Destructor.
 
const charwhat () const noexcept override
 Returns error message (implements std::exception interface). Returns empty string "" if no message was set.
 
const charGetMessageString () const noexcept
 Returns error message.
 
virtual const charExceptionType () const noexcept
 Returns the exception type name. Default implementation returns "Standard_Failure". Derived classes override this to return their own type name.
 
const charGetStackString () const
 Returns the stack trace string (empty string if not available).
 
void Print (Standard_OStream &theStream) const
 Prints on the stream theStream the exception name followed by the error message.
 

Static Public Member Functions

static int DefaultStackTraceLength ()
 Returns the default length of stack trace to be captured by Standard_Failure constructor; 0 by default meaning no stack trace.
 
static void SetDefaultStackTraceLength (int theNbStackTraces)
 Sets default length of stack trace to be captured by Standard_Failure constructor.
 

Detailed Description

Forms the root of the entire exception hierarchy. Inherits from std::exception and implements what() interface.

Constructor & Destructor Documentation

◆ Standard_Failure() [1/4]

Standard_Failure::Standard_Failure ( )

Creates a status object of type "Failure".

◆ Standard_Failure() [2/4]

Standard_Failure::Standard_Failure ( const Standard_Failure & theOther)

Copy constructor.

◆ Standard_Failure() [3/4]

Standard_Failure::Standard_Failure ( const char * theMessage)

Creates a status object of type "Failure" with message.

Parameters
[in]theMessageexception description

◆ Standard_Failure() [4/4]

Standard_Failure::Standard_Failure ( const char *const theMessage,
const char *const theStackTrace )

Creates a status object of type "Failure" with message and stack trace.

Parameters
[in]theMessageexception description
[in]theStackTracestack trace string

◆ ~Standard_Failure()

Standard_Failure::~Standard_Failure ( )
override

Destructor.

Member Function Documentation

◆ DefaultStackTraceLength()

static int Standard_Failure::DefaultStackTraceLength ( )
static

Returns the default length of stack trace to be captured by Standard_Failure constructor; 0 by default meaning no stack trace.

◆ ExceptionType()

virtual const char * Standard_Failure::ExceptionType ( ) const
inlinevirtualnoexcept

Returns the exception type name. Default implementation returns "Standard_Failure". Derived classes override this to return their own type name.

◆ GetMessageString()

const char * Standard_Failure::GetMessageString ( ) const
inlinenoexcept

Returns error message.

Deprecated
("Use what() instead")

◆ GetStackString()

const char * Standard_Failure::GetStackString ( ) const

Returns the stack trace string (empty string if not available).

◆ operator=()

Standard_Failure & Standard_Failure::operator= ( const Standard_Failure & theOther)

Assignment operator.

◆ Print()

void Standard_Failure::Print ( Standard_OStream & theStream) const

Prints on the stream theStream the exception name followed by the error message.

Note: there is a short-cut operator<< (Standard_OStream&, const Standard_Failure&)

◆ SetDefaultStackTraceLength()

static void Standard_Failure::SetDefaultStackTraceLength ( int theNbStackTraces)
static

Sets default length of stack trace to be captured by Standard_Failure constructor.

◆ what()

const char * Standard_Failure::what ( ) const
overridenoexcept

Returns error message (implements std::exception interface). Returns empty string "" if no message was set.


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