7#ifndef ARP_USE_ARP_SYSTEM_COMMONS_EXCEPTIONS
8#include "Arp/Base/Commons/Exceptions/NotAuthorizedException.hpp"
15#include "Arp/System/Commons/Exceptions/CommonException.hpp"
17namespace Arp {
namespace System {
namespace Commons
21class NotAuthorizedException :
public CommonException
24 template<
typename... Args>
25 NotAuthorizedException(
const char* message,
const Args& ... args);
26 NotAuthorizedException(
const String& message);
27 NotAuthorizedException(String&& message);
28 NotAuthorizedException(
const String& message,
const Exception& innerException);
29 NotAuthorizedException(String&& message, Exception&& innerException);
30 NotAuthorizedException(
const NotAuthorizedException& arg) =
default;
31 NotAuthorizedException(NotAuthorizedException&& arg) =
default;
32 virtual ~NotAuthorizedException(
void) =
default;
35 static NotAuthorizedException
Create(
const char* failedAction);
41 NotAuthorizedException& operator=(
const NotAuthorizedException& arg) =
delete;
44 static const char*
const defaultMessage;
51template<
typename... Args>
53 : CommonException(
ExceptionTypeId::NotAuthorized, String::Format(message, args...))
58inline NotAuthorizedException::NotAuthorizedException(
const String& message)
59 : CommonException(ExceptionTypeId::NotAuthorized, message)
64inline NotAuthorizedException::NotAuthorizedException(String&& message)
65 : CommonException(ExceptionTypeId::NotAuthorized,
std::move(message))
70inline NotAuthorizedException::NotAuthorizedException(
const String& message,
const Exception& innerException)
71 : CommonException(ExceptionTypeId::NotAuthorized, message, innerException)
76inline NotAuthorizedException::NotAuthorizedException(String&& message, Exception&& innerException)
77 : CommonException(ExceptionTypeId::NotAuthorized,
std::move(message),
std::move(innerException))
82inline NotAuthorizedException NotAuthorizedException::Create(
const char* failedAction)
84 return NotAuthorizedException(defaultMessage, failedAction);
91template<>
struct fmt::formatter<
Arp::System::Commons::NotAuthorizedException> :
public fmt::ostream_formatter {};
This exception is thrown when an operation is not authorized for the actual user.
Definition: NotAuthorizedException.hpp:16
NotAuthorizedException(const char *message, const Args &... args)
Creates an NotAuthorizedException with message.
Definition: NotAuthorizedException.hpp:67
std::unique_ptr< Exception > Ptr
The smart pointer type of this class.
Definition: Exception.hpp:27
@ 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