pstore2
Classes | Macros | Enumerations | Functions
error.hpp File Reference

Provides an pstore-specific error codes and a suitable error category for them. More...

#include <cstdlib>
#include <system_error>
#include "pstore/support/utf.hpp"
#include <iostream>
Include dependency graph for error.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  pstore::error_category
 
class  pstore::errno_erc
 This class is a tiny wrapper that allows an errno value to be passed to std::make_error_code(). More...
 
struct  std::is_error_code_enum< pstore::error_code >
 
struct  std::is_error_code_enum< pstore::errno_erc >
 

Macros

#define PSTORE_ERROR_CODES
 
#define X(a)   a,
 

Enumerations

enum  error_code : int { PSTORE_ERROR_CODES }
 

Functions

std::error_category const & pstore::get_error_category ()
 
std::error_code pstore::make_error_code (error_code const erc)
 
std::error_code pstore::make_error_code (errno_erc const erc) noexcept
 
template<typename Exception , typename = typename std::enable_if< std::is_base_of<std::exception, Exception>::value>::type>
PSTORE_NO_RETURN void pstore::raise_exception (Exception const &exc)
 
template<typename ErrorCode >
PSTORE_NO_RETURN void pstore::raise_error_code (ErrorCode erc)
 
template<typename ErrorCode , typename StrType >
PSTORE_NO_RETURN void pstore::raise_error_code (ErrorCode erc, StrType const &what)
 
template<typename ErrorType >
PSTORE_NO_RETURN void pstore::raise (ErrorType erc)
 
template<typename ErrorType , typename StrType >
PSTORE_NO_RETURN void pstore::raise (ErrorType erc, StrType const &what)
 

Detailed Description

Provides an pstore-specific error codes and a suitable error category for them.

Macro Definition Documentation

◆ PSTORE_ERROR_CODES

#define PSTORE_ERROR_CODES
Value:
X (none) \
X (transaction_on_read_only_database) /* an attempt to create a transaction when the database \
is read-only */ \
X (unknown_revision) \
X (header_corrupt) \
X (header_version_mismatch) \
X (footer_corrupt) \
X (index_corrupt) \
X (bad_alignment) /* an address was not correctly aligned for its pointee type */ \
X (index_not_latest_revision) \
X (unknown_process_path) /* could not discover the path of the calling process image*/ \
X (store_closed) /*an attempt to read or write from a store which is not open*/ \
X (cannot_allocate_after_commit) /*cannot allocate data after a transaction has been \
committed*/ \
X (bad_address) /*an attempt to address an address outside of the allocated storage*/ \
X (read_only_address) /* an attempt to write to read-only storage*/ \
X (did_not_read_number_of_bytes_requested) \
X (uuid_parse_error) \
X (bad_message_part_number) \
X (unable_to_open_named_pipe) \
X (pipe_write_timeout) \
X (write_failed)