libkeepass 0.2.0
KeePass key database importer/exporter library
Loading...
Searching...
No Matches
exception.hh File Reference

Exception types thrown by the library. More...

#include <cstdint>
#include <optional>
#include <string>
#include <utility>
#include "libkeepass/export.hh"

Go to the source code of this file.

Classes

class  keepass::Error
 Common base class for all libkeepass exceptions. More...
 
class  keepass::PasswordError
 Thrown when an invalid password is supplied while opening a database. More...
 
class  keepass::FormatError
 Thrown when a database or stream has an invalid format. More...
 
class  keepass::UnsupportedFeatureError
 Thrown when a database uses a valid but unsupported format feature. More...
 
class  keepass::ResourceLimitError
 Thrown when a parser, decompressor or XML budget is exceeded. More...
 
class  keepass::InternalError
 Thrown for the same class of errors as asserts, but in release builds. More...
 
class  keepass::IoError
 Thrown for input/output errors while reading or writing databases. More...
 
class  keepass::FileNotFoundError
 Thrown when a requested file does not exist. More...
 

Enumerations

enum class  keepass::ErrorCategory {
  kAuthentication , kFormat , kUnsupported , kResourceLimit ,
  kIo , kInternal
}
 Coarse error category shared by all library exceptions. More...
 

Functions

LIBKEEPASS_API const char * keepass::ErrorCategoryName (ErrorCategory category) noexcept
 Returns a stable, lowercase name for an error category.
 

Detailed Description

Exception types thrown by the library.

Enumeration Type Documentation

◆ ErrorCategory

enum class keepass::ErrorCategory
strong

Coarse error category shared by all library exceptions.

The category is stable API: it can be used by callers (and the CLI) to map failures to user-facing exit codes or messages without relying on the exact exception class or the message text.

Enumerator
kAuthentication 

Wrong password, key file or key.

kFormat 

Corrupt, truncated or otherwise invalid database.

kUnsupported 

A valid but unsupported format feature/version.

kResourceLimit 

A parser/decompression resource budget was exceeded.

kIo 

Reading or writing failed.

kInternal 

An internal invariant or allocation failed.