libkeepass 0.2.0
KeePass key database importer/exporter library
Loading...
Searching...
No Matches
keepass::FormatError Class Reference

Thrown when a database or stream has an invalid format. More...

#include <exception.hh>

Inheritance diagram for keepass::FormatError:
keepass::Error keepass::ResourceLimitError keepass::UnsupportedFeatureError

Public Member Functions

 FormatError (std::string msg)
 
 FormatError (std::string msg, uint64_t offset)
 
const char * what () const noexcept override
 
std::optional< uint64_t > offset () const noexcept
 Returns the byte offset of the failure, if known.
 
ErrorCategory category () const noexcept override
 Returns the coarse category of this error.
 

Detailed Description

Thrown when a database or stream has an invalid format.

The optional offset can point at the first byte that failed validation, which is useful for diagnostics in large or truncated files.

Constructor & Destructor Documentation

◆ FormatError()

keepass::FormatError::FormatError ( std::string  msg,
uint64_t  offset 
)
inline
Parameters
msgHuman-readable description (must not contain key material).
offsetByte offset in the input at which the error was detected.

Member Function Documentation

◆ category()

ErrorCategory keepass::FormatError::category ( ) const
inlineoverridevirtualnoexcept

Returns the coarse category of this error.

Implements keepass::Error.

Reimplemented in keepass::UnsupportedFeatureError, and keepass::ResourceLimitError.


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