Skip to content

BitException

Oz edited this page Sep 25, 2024 · 12 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, const tstring& file )
BitException( const char* message, std::error_code code, FailedFiles&& files = {} )
BitException( const char* message, std::error_code code, tstring&& file )
BitException( const std::string& message, std::error_code code )
const FailedFiles & failedFiles() const noexcept
HRESULT hresultCode() const noexcept
native_code_type nativeCode() const noexcept
int posixCode() const noexcept

Member Function Documentation

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.
  • code: the HRESULT code associated with the exception object.
  • file: the file that failed during the operation.

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, 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.
  • code: the HRESULT code associated with the exception object.
  • file: the file that failed during the operation.

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.

const FailedFiles & failedFiles() const noexcept

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


HRESULT hresultCode() const noexcept

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


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.


int posixCode() const noexcept

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


Clone this wiki locally