46
46
typedef std::pair<std::string, std::string> value_type;
47
typedef boost::unordered_map<uint32_t, value_type> ErrorMessageMap;
47
typedef boost::unordered_map<drizzled::error_t, value_type> ErrorMessageMap;
51
51
// Insert the message for the error. If the error already has an existing
52
52
// mapping, an error is logged, but the function continues.
53
void add(uint32_t error_num, const std::string &error_name, const std::string &message);
53
void add(drizzled::error_t error_num, const std::string &error_name, const std::string &message);
55
55
// If there is no error mapping for the error_num, ErrorStringNotFound is raised.
56
const std::string &find(uint32_t error_num) const;
56
const std::string &find(drizzled::error_t error_num) const;
58
58
static const ErrorMessageMap& get_error_message_map();
68
typedef void (*error_handler_func)(uint32_t my_err,
68
typedef void (*error_handler_func)(drizzled::error_t my_err,
71
71
extern error_handler_func error_handler_hook;
73
73
// TODO: kill this method. Too much to do with this branch.
74
74
// This is called through the ER(x) macro.
75
const char * error_message(unsigned int err_index);
75
const char * error_message(drizzled::error_t err_index);
77
77
// Adds the message to the global error dictionary.
78
void add_error_message(uint32_t error_code, const std::string &error_name,
78
void add_error_message(drizzled::error_t error_code, const std::string &error_name,
79
79
const std::string& message);
80
80
#define DRIZZLE_ADD_ERROR_MESSAGE(code, msg) add_error_message(code, STRINGIFY_ARG(code), msg)
82
82
void my_error(error_t nr, drizzled::Identifier::const_reference ref, myf MyFlags= MYF(0));
83
83
void my_error(error_t nr);
84
84
void my_error(error_t nr, myf MyFlags, ...);
85
void my_message(uint32_t my_err, const char *str, myf MyFlags);
86
void my_printf_error(uint32_t my_err, const char *format,
85
void my_message(drizzled::error_t my_err, const char *str, myf MyFlags);
86
void my_printf_error(drizzled::error_t my_err, const char *format,
88
88
__attribute__((format(printf, 2, 4)));