PLCnext API Documentation  22.9.0.33
Public Types | Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
Arp::Exception Class Reference

This is the base class of all Arp exception classes. More...

#include <Exception.hpp>

Inheritance diagram for Arp::Exception:
Inheritance graph

Public Types

typedef std::shared_ptr< ExceptionPtr
 The smart pointer tpye of this class. More...
 

Public Member Functions

template<typename... Args>
 Exception (const char *message, const Args &... args)
 Constructs an instance of class Exception. More...
 
 Exception (const String &message)
 Constructs an instance of class Exception. More...
 
 Exception (String &&message)
 Constructs an instance of class Exception. More...
 
 Exception (const String &message, const Exception &innerException)
 Constructs an instance of class Exception. More...
 
 Exception (String &&message, Exception &&innerException)
 Constructs an instance of class Exception. More...
 
 Exception (const Exception &arg)=default
 Constructs an instance of class Exception. More...
 
 Exception (Exception &&arg)=default
 Constructs an instance of class Exception. More...
 
virtual ~Exception (void)=default
 Destructs this instance virually. More...
 
uint32 GetTypeCode (void) const
 Gets the type code of this exception. More...
 
const StringGetMessage (void) const
 Gets the error message of this exception. More...
 
bool HasInnerException (void) const
 Determines if this exception has an inner exception. More...
 
Exception::Ptr GetInnerException (void) const
 Gets the inner exception of this exception. More...
 
String ToString (void) const
 Gets a reasonable string representation of this exception. More...
 

Protected Member Functions

 Exception (String &&message, const Exception::Ptr &innerExceptionPtr)
 Constructs an instance of class Exception. More...
 
virtual Exception::Ptr Clone (void) const
 Clones this instance. More...
 
virtual String Format (int indentLevel, bool withInnerException) const
 Formats this exception using the given indent level. More...
 
virtual uint32 GetTypeCodeInternal (void) const
 Get the type code of this exception. Must be overridden by derived classes. More...
 

Static Protected Attributes

static const int indentSize = 3
 The indentation size (count of blanks)
 
static const int indentChar = ' '
 The indentation character (blank)
 
static const int innerIndentChar = '-'
 The indentation character to indent inner exceptions.
 

Detailed Description

This is the base class of all Arp exception classes.

Member Typedef Documentation

◆ Ptr

typedef std::shared_ptr<Exception> Arp::Exception::Ptr

The smart pointer tpye of this class.

Constructor & Destructor Documentation

◆ Exception() [1/8]

template<typename... Args>
Arp::Exception::Exception ( const char *  message,
const Args &...  args 
)
inline

Constructs an instance of class Exception.

Parameters
messageThe error message of this exception.
argsThe arguments of the message, which are formatted into the message parameter.

◆ Exception() [2/8]

Arp::Exception::Exception ( const String message)
inline

Constructs an instance of class Exception.

Parameters
messageThe error message of this exception.

◆ Exception() [3/8]

Arp::Exception::Exception ( String &&  message)
inline

Constructs an instance of class Exception.

Parameters
messageThe error message of this exception.

◆ Exception() [4/8]

Arp::Exception::Exception ( const String message,
const Exception innerException 
)
inline

Constructs an instance of class Exception.

Parameters
messageThe error message of this exception.
innerExceptionThe inner exception of this exception.

◆ Exception() [5/8]

Arp::Exception::Exception ( String &&  message,
Exception &&  innerException 
)
inline

Constructs an instance of class Exception.

Parameters
messageThe error message of this exception.
innerExceptionThe inner exception of this exception.

◆ Exception() [6/8]

Arp::Exception::Exception ( const Exception arg)
default

Constructs an instance of class Exception.

Parameters
argThe argument to copy.

◆ Exception() [7/8]

Arp::Exception::Exception ( Exception &&  arg)
default

Constructs an instance of class Exception.

Parameters
argThe argument to move.

◆ ~Exception()

virtual Arp::Exception::~Exception ( void  )
virtualdefault

Destructs this instance virually.

◆ Exception() [8/8]

Arp::Exception::Exception ( String &&  message,
const Exception::Ptr innerExceptionPtr 
)
inlineprotected

Constructs an instance of class Exception.

Parameters
messageThe error message of this exception.
innerExceptionPtrThe inner exception of this exception.

Member Function Documentation

◆ Clone()

virtual Exception::Ptr Arp::Exception::Clone ( void  ) const
protectedvirtual

Clones this instance.

Returns
A (deep) clone of this instance.

Reimplemented in Arp::System::Commons::XmlValidationException, Arp::System::Commons::XmlException, Arp::System::Commons::TimeoutException, Arp::System::Commons::ThreadInterruptException, Arp::System::Commons::Plc::StringException, Arp::System::Commons::Plc::StackOverflowException, Arp::System::Commons::Plc::PlcException, Arp::System::Commons::Plc::IndexOutOfRangeException, Arp::System::Commons::Plc::DivisionByZeroException, Arp::System::Commons::ParseException, Arp::System::Commons::OutOfMemoryException, Arp::System::Commons::ObjectDisposedException, Arp::System::Commons::NotSupportedException, Arp::System::Commons::NotImplementedException, Arp::System::Commons::NotAuthorizedException, Arp::System::Commons::LicenseException, Arp::System::Commons::KeyNotFoundException, Arp::System::Commons::Io::OutOfSpaceException, Arp::System::Commons::Io::NotExistException, Arp::System::Commons::Io::IoException, Arp::System::Commons::Io::InvalidPathException, Arp::System::Commons::Io::EndOfStreamException, Arp::System::Commons::Io::AlreadyExistsException, Arp::System::Commons::Io::AccessDeniedException, Arp::System::Commons::InvalidOperationException, Arp::System::Commons::InvalidFormatException, Arp::System::Commons::InvalidDataConnectionException, Arp::System::Commons::InvalidConfigException, Arp::System::Commons::InvalidCastException, Arp::System::Commons::IndexOutOfRangeException, Arp::System::Commons::ArgumentOutOfRangeException, Arp::System::Commons::ArgumentNullException, and Arp::System::Commons::ArgumentException.

◆ Format()

virtual String Arp::Exception::Format ( int  indentLevel,
bool  withInnerException 
) const
protectedvirtual

Formats this exception using the given indent level.

Parameters
indentLevelThe indentation level used for formatting.
withInnerExceptionIf true the inner exception (if any) sould be formatted into the resulting string as well.
Returns
The formatted string representation of this instance.

Reimplemented in Arp::System::Commons::CommonException.

◆ GetInnerException()

Exception::Ptr Arp::Exception::GetInnerException ( void  ) const
inline

Gets the inner exception of this exception.

Returns
The inner exception of this exception.

◆ GetMessage()

const String & Arp::Exception::GetMessage ( void  ) const
inline

Gets the error message of this exception.

Returns
The error message of this exception.

◆ GetTypeCode()

uint32 Arp::Exception::GetTypeCode ( void  ) const
inline

Gets the type code of this exception.

Returns
The type code of this exception.

Returns 0 for class Exception and any value of enum ExceptionTypeId for any derived class.

◆ GetTypeCodeInternal()

virtual uint32 Arp::Exception::GetTypeCodeInternal ( void  ) const
protectedvirtual

Get the type code of this exception. Must be overridden by derived classes.

Returns
The type code of this exception.

Implements the templated method pattern to retrieve the correct type code from derived exceptions.

Reimplemented in Arp::System::Commons::CommonException.

◆ HasInnerException()

bool Arp::Exception::HasInnerException ( void  ) const
inline

Determines if this exception has an inner exception.

Returns
true if this exception has an inner exception, otherwise false.

◆ ToString()

String Arp::Exception::ToString ( void  ) const

Gets a reasonable string representation of this exception.

Returns
A reasonable string representation of this exception.

The resulting string contains a reasonable error message and the entire stacktrace of any derived exception from Arp::System::Commons.


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