xentara-utils v1.2.1
Xentara utilities library
Loading...
Searching...
No Matches
xentara::utils::windows::com::Exception Class Reference

An exception that wraps an IErrorInfo COM object. More...

#include <windows/com/Errors.hpp>

+ Inheritance diagram for xentara::utils::windows::com::Exception:

Public Member Functions

 Exception (ObjectHandle< IErrorInfo > &&errorInfo, const std::string &what)
 Creates an erro info object.
 
 Exception (ObjectHandle< IErrorInfo > &&errorInfo, const char *what)
 Creates an erro info object.
 
auto errorInfo () const -> IErrorInfo &
 Returns the error info.
 
auto what () const noexcept -> const char *
 Returns the explanatory string.
 
- Public Member Functions inherited from std::runtime_error
T runtime_error (T... args)
 
T what (T... args)
 

Detailed Description

An exception that wraps an IErrorInfo COM object.

Constructor & Destructor Documentation

◆ Exception() [1/2]

xentara::utils::windows::com::Exception::Exception ( ObjectHandle< IErrorInfo > &&  errorInfo,
const std::string what 
)

Creates an erro info object.

Parameters
errorInfoThe error info. Must not be a null handle.
whatAn exlanatory string describing the error. This string will appear in the what() string, together with the error message from errorInfo.

◆ Exception() [2/2]

xentara::utils::windows::com::Exception::Exception ( ObjectHandle< IErrorInfo > &&  errorInfo,
const char *  what 
)

Creates an erro info object.

Parameters
errorInfoThe error info. Must not be a null handle.
whatAn exlanatory string describing the error. This string will appear in the what() string, together with the error message from errorInfo.

Member Function Documentation

◆ errorInfo()

auto xentara::utils::windows::com::Exception::errorInfo ( ) const -> IErrorInfo &

Returns the error info.

Note
This function returns a non-const IErrorInfo reference. This is because the Windows COM interface is not const-correct, and methods like GetDescription() cannot be called using a const reference.
Returns
The error info object.

◆ what()

auto xentara::utils::windows::com::Exception::what ( ) const -> const char *
noexcept

Returns the explanatory string.