Class BitException

Synopsis

#include <include/bitexception.hpp>

class BitException : public runtime_error

Description

The BitException class represents a generic exception thrown from the bit7z classes.

Mentioned in

Inheritance

Ancestors: std::runtime_error

Methods

BitException OverloadConstructs a BitException object with the given message.
getErrorCodeReturn the HRESULT code associated with the exception object.

Source

Lines 34-85 in include/bitexception.hpp.

class BitException : public runtime_error {
    public:
        /**
         * @brief Constructs a BitException object with the given message.
         *
         * @param message   the message associated with the exception object.
         * @param code      the HRESULT code associated with the exception object.
         */
        explicit BitException( const char* message, HRESULT code = E_FAIL );
        /**
         * @brief Constructs a BitException object with the given message.
         *
         * @note The Win32 error code is converted to a HRESULT code through HRESULT_FROM_WIN32 macro.
         *
         * @param message   the message associated with the exception object.
         * @param code      the Win32 error code associated with the exception object.
         */
        BitException( const char* message, DWORD code );
        /**
         * @brief Constructs a BitException object with the given message.
         *
         * @note The wstring argument is converted into a string and then passed to the base
         * class constructor.
         *
         * @param message   the message associated with the exception object.
         * @param code      the HRESULT code associated with the exception object.
         */
        explicit BitException( const wstring& message, HRESULT code = E_FAIL );
        /**
         * @brief Constructs a BitException object with the given message.
         *
         * @note The wstring argument is converted into a string and then passed to the base
         * class constructor.
         *
         * @note The Win32 error code is converted to a HRESULT code through HRESULT_FROM_WIN32 macro.
         *
         * @param message   the message associated with the exception object.
         * @param code      the Win32 error code associated with the exception object.
         */
        BitException( const wstring& message, DWORD code );
        /**
         * @return the HRESULT code associated with the exception object.
         */
        HRESULT getErrorCode();
    private:
        HRESULT mErrorCode;
};





Add Discussion as Guest

Log in