Skip to main content

DPF C++ client library 2023 R2

ansys::dpf::DpfError Class Reference

Last update: 10.07.2023

#include <dpf_api_base.h>

Public Types

enum  ErrorNature {
  eUnknown , eOk , eComponentLoading , eFileNotFound ,
  eRuntimeError , eWrongOutputType , eFailure , eUnexpectedVoidReturn ,
  eUnexpectedVoidEntity , eUnimplemented , eUserInterrupted , eLicensingFailure
}
 

Public Member Functions

 DpfError (ErrorNature nature, std::string const &origin, std::string const &message)
 
virtual const char * what () const noexcept
 
const char * message () const noexcept
 
const char * origin () const noexcept
 
ErrorNature nature () const noexcept
 
bool isOk () const noexcept
 
void clear () noexcept
 

Detailed Description

Member Enumeration Documentation

◆ ErrorNature

Type of error

Enumerator
eUnknown 

Unknown error.

eOk 

No error.

eComponentLoading 

Error loading component.

eFileNotFound 

File not found error.

eRuntimeError 

Any type of runtime error.

eWrongOutputType 

Wrong output type.

eFailure 

Functionality cannot be completed.

eUnexpectedVoidReturn 

Return value expected.

eUnexpectedVoidEntity 

Return value expected.

eUnimplemented 

Functionality not implemented.

eUserInterrupted 

Execution interupted by user.

eLicensingFailure 

Licensing checks failed.

Constructor & Destructor Documentation

◆ DpfError()

ansys::dpf::DpfError::DpfError ( ErrorNature  nature,
std::string const &  origin,
std::string const &  message 
)

Create DPF error.

Parameters
[in]natureType of error.
[in]originOriginator of error.
[in]messageError message.

Member Function Documentation

◆ clear()

void ansys::dpf::DpfError::clear ( )
noexcept

Reset to empty state.

◆ isOk()

bool ansys::dpf::DpfError::isOk ( ) const
noexcept
Returns
Indication of error.
Examples
ResultTest.cpp.

◆ message()

const char * ansys::dpf::DpfError::message ( ) const
noexcept
Returns
User supplied error message.

◆ nature()

ErrorNature ansys::dpf::DpfError::nature ( ) const
noexcept
Returns
Type of error.

◆ origin()

const char * ansys::dpf::DpfError::origin ( ) const
noexcept
Returns
Originator of error.

◆ what()

virtual const char * ansys::dpf::DpfError::what ( ) const
virtualnoexcept
Returns
Full error message.