RPNX::Compress
Self-contained C++20 compression and ZIP library
 
Loading...
Searching...
No Matches
rpnx::compression::compression_error Class Referencefinal

Exception raised for malformed streams, invalid options, and codec failures. More...

#include <compression.hpp>

Inheritance diagram for rpnx::compression::compression_error:

Public Member Functions

 compression_error (error_code code, format stream_format, std::string message)
 Constructs a compression exception.
 
char const * what () const noexcept override
 Returns the human-readable diagnostic.
 
error_code code () const noexcept
 Returns the stable error category.
 
format stream_format () const noexcept
 Returns the stream format involved in the error.
 

Detailed Description

Exception raised for malformed streams, invalid options, and codec failures.

The error category and stream format are stable programmatic context. The diagnostic returned by what() is intended for humans and is not a stable API.

Definition at line 95 of file compression.hpp.

Constructor & Destructor Documentation

◆ compression_error()

rpnx::compression::compression_error::compression_error ( error_code code,
format stream_format,
std::string message )

Constructs a compression exception.

Parameters
codeStable category for the failure.
stream_formatWire format being processed when the failure occurred.
messageHuman-readable diagnostic retained by the exception.

References code(), and stream_format().

Member Function Documentation

◆ code()

error_code rpnx::compression::compression_error::code ( ) const
nodiscardnoexcept

Returns the stable error category.

Returns
The category supplied at construction.

References code().

Referenced by code(), and compression_error().

◆ stream_format()

format rpnx::compression::compression_error::stream_format ( ) const
nodiscardnoexcept

Returns the stream format involved in the error.

Returns
The format supplied at construction.

References stream_format().

Referenced by compression_error(), and stream_format().

◆ what()

char const * rpnx::compression::compression_error::what ( ) const
nodiscardoverridenoexcept

Returns the human-readable diagnostic.

Returns
A null-terminated string valid until the exception is destroyed.

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