13#ifndef _AUROSTD_XERROR_CPP_
14#define _AUROSTD_XERROR_CPP_
26#define _AFLOW_NUM_ERR_TYPES_ 7
34 {
"Generic error",
"Illegal error code",
"",
"",
"",
"",
"",
"",
""},
35 {
"unknown flag",
"missing flag",
"input ambiguous",
"illegal parameter",
"number of parameters",
"",
"",
"",
""},
36 {
"file not found",
"wrong format",
"file corrupt",
"",
"",
"",
"",
"",
""},
37 {
"illegal value",
"out of range",
"",
"",
"",
"",
"",
"",
""},
38 {
"illegal value",
"out of bounds",
"mismatch",
"",
"",
"",
"",
"",
""},
39 {
"not initialized",
"SQL error",
"busy",
"external command not found",
"external command failed",
"HTTP error",
"",
"",
""},
40 {
"could not allocate",
"insufficient memory",
"",
"",
"",
"",
"",
"",
""}
44 xerror::xerror(
const std::string& filename,
const std::string& function,
const std::string& msg,
int code) {
48 xerror::xerror(
const std::string& filename,
const std::string& function,
const std::stringstream& msg,
int code) {
52 xerror::xerror(
const std::string& filename,
const std::stringstream& function,
const std::string& msg,
int code) {
56 xerror::xerror(
const std::string& filename,
const std::stringstream& function,
const std::stringstream& msg,
int code) {
62 void xerror::buildException(
const std::string& filename,
const std::string& fname,
const std::string& msg,
const int& code) {
99 std::stringstream msgstr;
106 msgstr <<
"There was an error, but the supplied error code is invalid. Please contact the developers. ";
107 msgstr <<
"Supplied error message: ";
122 std::stringstream errorstr;
127 errorstr <<
"generic";
135 return errorstr.str();
#define _AFLOW_NUM_ERR_TYPES_
std::string error_string() const
std::string buildMessageString()
std::string function_name
std::string whereFileName()
void buildException(const std::string &, const std::string &, const std::string &, const int &)
std::string whereFunction()
xerror(const std::string &, const std::string &, const std::string &, int=1)
std::string error_message
static const std::string error_types[_AFLOW_NUM_ERR_TYPES_]
static const std::string errors[_AFLOW_NUM_ERR_TYPES_][9]