Skip to content

BitException

Oz edited this page Jan 20, 2023 · 11 revisions

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

#include <bit7z/bitexception.hpp>

inherits from system_error.

List of all members

Public Members

Return type Name
BitException( const char* message, std::error_code code, FailedFiles&& files = {} )
BitException( const char* message, std::error_code code, const tstring& file )
BitException( const std::string& message, std::error_code code )
native_code_type nativeCode() const noexcept
HRESULT hresultCode() const noexcept
int posixCode() const noexcept
const FailedFiles & failedFiles() const noexcept

Member Function Documentation

BitException( const char* message, std::error_code code, FailedFiles&& files = {} )

Constructs a BitException object with the given message, and the specific files that failed.

Parameters:

  • message: the message associated with the exception object.
  • files: the vector of files that failed, with the corresponding error codes.
  • code: the HRESULT code associated with the exception object.

BitException( const char* message, std::error_code code, const tstring& file )

Constructs a BitException object with the given message, and the specific file that failed.

Parameters:

  • message: the message associated with the exception object.
  • file: the file that failed during the operation.
  • code: the HRESULT code associated with the exception object.

BitException( const std::string& message, std::error_code code )

Constructs a BitException object with the given message.

Parameters:

  • message: the message associated with the exception object.
  • code: the HRESULT code associated with the exception object.

native_code_type nativeCode() const noexcept

Returns the native error code (e.g., HRESULT on Windows, int elsewhere) corresponding to the exception's std::error_code.

HRESULT hresultCode() const noexcept

Returns the HRESULT error code corresponding to the exception's std::error_code.

int posixCode() const noexcept

Returns the POSIX error code corresponding to the exception's std::error_code.

const FailedFiles & failedFiles() const noexcept

Returns the vector of files that caused the exception to be thrown, along with the corresponding error codes.

Clone this wiki locally