powerd++  0.4.4
Classes | Namespaces | Enumerations | Functions | Variables
errors.hpp File Reference

Common error handling code. More...

#include "utility.hpp"
Include dependency graph for errors.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  errors::Exception
 Exceptions bundle an exit code, errno value and message. More...
 

Namespaces

 errors
 Common error handling types and functions.
 

Enumerations

enum  errors::Exit : int {
  errors::Exit::OK, errors::Exit::ECLARG, errors::Exit::EOUTOFRANGE, errors::Exit::ELOAD,
  errors::Exit::EFREQ, errors::Exit::EMODE, errors::Exit::EIVAL, errors::Exit::ESAMPLES,
  errors::Exit::ESYSCTL, errors::Exit::ENOFREQ, errors::Exit::ECONFLICT, errors::Exit::EPID,
  errors::Exit::EFORBIDDEN, errors::Exit::EDAEMON, errors::Exit::EWOPEN, errors::Exit::ESIGNAL,
  errors::Exit::ERANGEFMT, errors::Exit::ETEMPERATURE, errors::Exit::EEXCEPT, errors::Exit::EFILE,
  errors::Exit::EEXEC, errors::Exit::EDRIVER, errors::Exit::ESYSCTLNAME, errors::Exit::EFORMATFIELD,
  errors::Exit::LENGTH
}
 Exit codes. More...
 

Functions

void errors::fail (Exit const exitcode, int const err, std::string const &msg)
 Throws an Exception instance with the given message. More...
 

Variables

const char *const errors::ExitStr []
 Printable strings for exit codes. More...
 

Detailed Description

Common error handling code.


Class Documentation

◆ errors::Exception

struct errors::Exception

Exceptions bundle an exit code, errno value and message.

Collaboration diagram for errors::Exception:
[legend]
Class Members
int err The errno value at the time of creation.
Exit exitcode The code to exit with.
string msg An error message.