8#include "Arp/System/Commons/Exceptions/CommonException.hpp"
9#include "Arp/System/Rsc/Services/RscErrors.h"
11namespace Arp {
namespace System {
namespace Rsc {
namespace Services
21 template<
typename... Args>
22 RscException(
int rscErrorCode,
const char* message,
const Args& ... args);
23 RscException(
int rscErrorCode,
const String& message);
24 RscException(
int rscErrorCode, String&& message);
25 RscException(
int rscErrorCode,
const String& message,
const Exception& innerException);
26 RscException(
int rscErrorCode, String&& message, Exception&& innerException);
27 RscException(
const RscException& arg) =
default;
28 RscException(RscException&& arg) =
default;
29 virtual ~RscException(
void) =
default;
32 RscErrors GetErrorCode(
void)
const;
36 String Format(
int indentLevel,
bool withInnerException)
const override;
40 static RscException
Create(RscErrors rscErrorCode = DefaultError);
41 static RscException
Create(
const Exception& innerExeption, RscErrors rscErrorCode = DefaultError);
44 RscException& operator=(
const RscException& arg) =
delete;
47 RscErrors rscError = DefaultError;
50 static const RscErrors DefaultError = RscErrors::InternalError;
51 static const String DefaultMessage;
56template<
typename... Args>
57inline RscException::RscException(
int rscErrorCode,
const char* message,
const Args& ... args)
59 , rscError((RscErrors)rscErrorCode)
63inline RscException::RscException(
int rscErrorCode,
const String& message)
65 , rscError((RscErrors)rscErrorCode)
69inline RscException::RscException(
int rscErrorCode,
String&& message)
71 , rscError((RscErrors)rscErrorCode)
75inline RscException::RscException(
int rscErrorCode,
const String& message,
const Exception& innerException)
77 , rscError((RscErrors)rscErrorCode)
81inline RscException::RscException(
int rscErrorCode,
String&& message, Exception&& innerException)
83 , rscError((RscErrors)rscErrorCode)
87inline RscErrors RscException::GetErrorCode(
void)
const
89 return this->rscError;
92inline RscException RscException::Create(RscErrors rscErrorCode)
94 return RscException((
int)rscErrorCode, DefaultMessage);
std::shared_ptr< Exception > Ptr
The smart pointer tpye of this class.
Definition: Exception.hpp:19
This is the base class of common exception classes.
Definition: CommonException.hpp:19
Arp::BasicString< char8 > String
The Arp String class.
Definition: TypeSystem.h:27
@ System
System components used by the System, Device, Plc or Io domains.
@ Create
Creates a new file. If the file already exists, it is overwritten.
ExceptionTypeId
Specifies the type id of any exception derived by <see cref="CommonException".
Definition: ExceptionTypeId.hpp:15
Root namespace for the PLCnext API
Namespace of the C++ standard library