Microsoft Information Protection SDK - C++ 1.17
API Reference Documentation for C++
Loading...
Searching...
No Matches
Error Class Referenceabstract

Base class for all errors that will be reported (thrown or returned) from MIP SDK. More...

#include <error.h>

Inheritance diagram for Error:
AccessDeniedError AdhocProtectionRequiredError BadInputError ConsentDeniedError DelegateResponseError DeprecatedApiError FileIOError InternalError JustificationRequiredError NetworkError NoPolicyError NotSupportedError OperationCancelledError PrivilegedRequiredError

Public Member Functions

char const * what () const noexcept override
 Get the error message.
 
virtual std::shared_ptr< ErrorClone () const =0
 Clone the error.
 
virtual ErrorType GetErrorType () const
 Get the error type.
 
const std::string & GetErrorName () const
 Get the error name.
 
const std::string & GetMessage (bool maskPII=false) const
 Get the error message.
 
void SetMessage (const std::string &msg)
 Set the error message.
 
void AddDebugInfo (const std::string &key, const std::string &value, bool sensitive=false)
 Add debug info entry.
 
const std::map< std::string, std::string > & GetDebugInfo () const
 Get debug info.
 

Public Attributes

std::string mMessage
 
std::map< std::string, std::string > mDebugInfo
 
std::string mName
 
ErrorType mType
 

Private Member Functions

std::string CreateFormattedMessage (const std::string &message) const
 

Private Attributes

std::string mFormattedMessage
 
std::string mMaskedMessage
 

Detailed Description

Base class for all errors that will be reported (thrown or returned) from MIP SDK.

Member Function Documentation

◆ AddDebugInfo()

void Error::AddDebugInfo ( const std::string & key,
const std::string & value,
bool sensitive = false )
inline

Add debug info entry.

Parameters
keyDebug info key
valueDebug info value

◆ Clone()

virtual std::shared_ptr< Error > Error::Clone ( ) const
pure virtual

Clone the error.

Returns
a clone of the error.

Implemented in JustificationRequiredError.

◆ CreateFormattedMessage()

std::string Error::CreateFormattedMessage ( const std::string & message) const
inlineprivate

◆ GetDebugInfo()

const std::map< std::string, std::string > & Error::GetDebugInfo ( ) const
inline

Get debug info.

Returns
Debug info (keys/values)

◆ GetErrorName()

const std::string & Error::GetErrorName ( ) const
inline

Get the error name.

Returns
the error name.

◆ GetErrorType()

virtual ErrorType Error::GetErrorType ( ) const
inlinevirtual

Get the error type.

Returns
the error type.

◆ GetMessage()

const std::string & Error::GetMessage ( bool maskPII = false) const
inline

Get the error message.

Returns
the error message.

◆ SetMessage()

void Error::SetMessage ( const std::string & msg)
inline

Set the error message.

Parameters
msgthe error message.

◆ what()

char const * Error::what ( ) const
inlineoverridenoexcept

Get the error message.

Returns
the error message

Member Data Documentation

◆ mDebugInfo

std::map<std::string, std::string> Error::mDebugInfo

◆ mFormattedMessage

std::string Error::mFormattedMessage
private

◆ mMaskedMessage

std::string Error::mMaskedMessage
private

◆ mMessage

std::string Error::mMessage

◆ mName

std::string Error::mName

◆ mType

ErrorType Error::mType

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