PLCnext API Documentation 25.0.2.69
|
This is the base class of all Arp exception classes. More...
#include <Exception.hpp>
Public Types | |
using | Ptr = std::unique_ptr< Exception > |
The smart pointer type of this class. | |
using | TypeCode = std::underlying_type< Arp::Base::Core::ExceptionTypeId >::type |
The integral type of the type code. | |
Public Member Functions | |
Exception (const Exception &arg) | |
Default copy constructor. | |
Exception (Exception &&arg) noexcept | |
Default move constructor. | |
Exception & | operator= (const Exception &arg) |
Default copy-assignment operator. | |
Exception & | operator= (Exception &&arg) noexcept |
Default move-assignment operator. | |
virtual | ~Exception (void) |
Default destructor. | |
Exception (void) | |
Constructs an empty instance of class Exception. | |
template<typename... Args> | |
Exception (const char *message, 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, const Exception &innerException) | |
Constructs an instance of class Exception. More... | |
const String & | GetMessage (void) const |
Gets the error message of this exception. More... | |
ExceptionTypeId | GetTypeId (void) const |
Gets the type ID of this exception. More... | |
TypeCode | GetTypeCode (void) const |
Gets the type code of this exception. More... | |
bool | HasInnerException (void) const |
Determines if this exception has an inner exception. More... | |
const Exception & | GetInnerException (void) const |
Gets the inner exception of this exception. More... | |
String | ToString (void) const |
This operation should be used for logging and returns a reasonable description of the exception cause. More... | |
virtual Exception::Ptr | Clone (void) const |
This operation clones this instance polymorphically as a deep copy. More... | |
virtual String | Format (bool withInnerException) const |
Formats this exception using the given indent level. More... | |
Impl & | GetImpl (void) |
For internal use only. | |
const Impl & | GetImpl (void) const |
Protected Member Functions | |
Exception (ExceptionTypeId typeId, String &&message) | |
Used by derived exception classes. More... | |
Exception (ExceptionTypeId typeId, const String &message) | |
Used by derived exception classes. More... | |
Exception (ExceptionTypeId typeId, String &&message, const Exception &innerException) | |
Used by derived exception classes. More... | |
Exception (ExceptionTypeId typeId, const String &message, const Exception &innerException) | |
Used by derived exception classes. More... | |
Exception (String &&message, const Exception::Ptr &innerExceptionPtr) | |
DEPRECATED. More... | |
String | Format (int indentLevel, bool withInnerException) const |
DEPRECATED. More... | |
virtual uint32 | GetTypeCodeInternal (void) const |
DEPRECATED. More... | |
Friends | |
ARP_EXPORT std::ostream & | operator<< (std::ostream &os, const Exception &arg) |
Makes the Exception class formattable. More... | |
This is the base class of all Arp exception classes.
This class does not provide a stack-trace. To avoid this issue, derive any custom exception class from Arp::System::Commons::Exceptions::CommonException
|
inline |
Constructs an instance of class Exception.
message | The error message of this exception. |
args | The arguments of the message, which are formatted into the message parameter. |
|
explicit |
Constructs an instance of class Exception.
message | The error message of this exception. |
|
explicit |
Constructs an instance of class Exception.
message | The error message of this exception. |
Constructs an instance of class Exception.
message | The error message of this exception. |
innerException | The inner exception of this exception. |
Constructs an instance of class Exception.
message | The error message of this exception. |
innerException | The inner exception of this exception. |
|
protected |
Used by derived exception classes.
typeId | The exception type ID of the derived exception. |
message | The error message of this exception. |
|
protected |
Used by derived exception classes.
typeId | The exception type ID of the derived exception. |
message | The error message of this exception. |
|
protected |
Used by derived exception classes.
typeId | The exception type ID of the derived exception. |
message | The error message of this exception. |
innerException | The inner exception of this exception. |
|
protected |
Used by derived exception classes.
typeId | The exception type ID of the derived exception. |
message | The error message of this exception. |
innerException | The inner exception of this exception. |
|
protected |
DEPRECATED.
Use the protected constructor 'Exception(ExceptionTypeId typeId, String&& message, const Exception& innerException)' instead to provide the 'typeId' of the derived exception.
|
virtual |
This operation clones this instance polymorphically as a deep copy.
Never forget to override this operation in any derived exception class.
Never ever forget to override this operation in any derived exception class.
Reimplemented in Arp::Base::Commons::Exceptions::ArgumentException, Arp::Base::Commons::Exceptions::ArgumentNullException, Arp::Base::Commons::Exceptions::ArgumentOutOfRangeException, Arp::Base::Commons::Exceptions::InvalidCastException, Arp::Base::Commons::Exceptions::InvalidOperationException, Arp::Base::Commons::Exceptions::Io::EndOfStreamException, Arp::Base::Commons::Exceptions::Io::IoException, Arp::Base::Commons::Exceptions::Io::PathNotExistException, Arp::Base::Commons::Exceptions::NotAuthorizedException, Arp::Base::Commons::Exceptions::NotImplementedException, Arp::Base::Commons::Exceptions::NotSupportedException, Arp::Base::Rsc::Commons::RscException, Arp::System::Commons::IndexOutOfRangeException, Arp::System::Commons::InvalidConfigException, Arp::System::Commons::InvalidDataConnectionException, Arp::System::Commons::InvalidFormatException, Arp::System::Commons::Io::AccessDeniedException, Arp::System::Commons::Io::AlreadyExistsException, Arp::System::Commons::Io::EndOfStreamException, Arp::System::Commons::Io::InvalidPathException, Arp::System::Commons::Io::IoException, Arp::System::Commons::Io::NotExistException, Arp::System::Commons::Io::OutOfSpaceException, Arp::System::Commons::JsonException, Arp::System::Commons::KeyNotFoundException, Arp::System::Commons::LicenseException, Arp::System::Commons::ObjectDisposedException, Arp::System::Commons::OutOfMemoryException, Arp::System::Commons::ParseException, Arp::System::Commons::Plc::DivisionByZeroException, Arp::System::Commons::Plc::IndexOutOfRangeException, Arp::System::Commons::Plc::PlcException, Arp::System::Commons::Plc::StackOverflowException, Arp::System::Commons::Plc::StringException, Arp::System::Commons::ThreadInterruptException, Arp::System::Commons::TimeoutException, Arp::System::Commons::XmlException, and Arp::System::Commons::XmlValidationException.
|
virtual |
Formats this exception using the given indent level.
withInnerException | If true the inner exception (if any) should be formatted into the resulting string as well. |
This operation might be overridden in derived classes to specialize the format when calling ToString.
Reimplemented in Arp::Base::Commons::Exceptions::CommonExceptionBase, and Arp::System::Commons::CommonException.
|
protected |
DEPRECATED.
Override this operation to apply special formatting of the exception.
Override 'String Exception::Format(bool withInnerException)const' instead.
const Exception & Arp::Base::Core::Exception::GetInnerException | ( | void | ) | const |
Gets the inner exception of this exception.
const String & Arp::Base::Core::Exception::GetMessage | ( | void | ) | const |
Gets the error message of this exception.
Exception::TypeCode Arp::Base::Core::Exception::GetTypeCode | ( | void | ) | const |
Gets the type code of this exception.
Returns 0
for class Exception and any value of enum ExceptionTypeId for any derived class.
|
protectedvirtual |
DEPRECATED.
Override this operation in derived classes to provide a specialized type code.
Remove the override of this operation, it's not required any more. The type code is determined by the 'typeId' which is passed to one of the protected constructors.
This default implementation returns 0
.
ExceptionTypeId Arp::Base::Core::Exception::GetTypeId | ( | void | ) | const |
Gets the type ID of this exception.
Returns ExceptionTypeId::Exception for class Exception and any value of enum ExceptionTypeId for any derived class.
bool Arp::Base::Core::Exception::HasInnerException | ( | void | ) | const |
Determines if this exception has an inner exception.
true
if this exception has an inner exception, otherwise false
.String Arp::Exception::ToString | ( | void | ) | const |
This operation should be used for logging and returns a reasonable description of the exception cause.
This operation should be used for logging and returns a reasonable description of the exception cause.
This operation might be overridden in any derived exception class to apply more infos like stack-trace, filename or line number. The default implementation just returns the message which was passed to the constructor and the exception string of the inner exception if any exist.
This operation might be overridden in any derived exception class to apply more infos like stacktracing, filename or line number. The default implementation just returns the message which was passed to the constructor and the exception string of the inner exception if any exist.
|
friend |
Makes the Exception class formattable.
os | The stream to write the exception to. |
arg | The exception to write. |