24 #include <boost/unordered_map.hpp>
26 #include <drizzled/common_fwd.h>
28 #include <drizzled/error/priority_t.h>
29 #include <drizzled/error_t.h>
30 #include <drizzled/identifier.h>
36 #define SC_MAXWIDTH 256
37 #define ERRMSGSIZE (SC_MAXWIDTH)
38 #define MY_FILE_ERROR ((size_t) -1)
39 #define ME_FATALERROR 1024
47 typedef std::pair<std::string, std::string> value_type;
48 typedef boost::unordered_map<error_t, value_type> ErrorMessageMap;
54 void add(error_t error_num,
const std::string &error_name,
const std::string &message);
56 const std::string* find(error_t error_num)
const;
58 static const ErrorMessageMap& get_error_message_map();
60 ErrorMessageMap mapping_;
63 typedef void (*error_handler_func)(error_t my_err,
66 extern error_handler_func error_handler_hook;
70 DRIZZLED_API const char * error_message(error_t err_index);
73 void add_error_message(error_t error_code,
const std::string &error_name,
74 const std::string& message);
75 #define DRIZZLE_ADD_ERROR_MESSAGE(code, msg) add_error_message(code, STRINGIFY_ARG(code), msg)
83 const std::string &verbose_string();
84 error::priority_t &verbosity();
85 void check_verbosity(
const std::string &arg);
90 DRIZZLED_API void my_error(
const std::string &ref, error_t nr, myf MyFlags= MYF(0));
91 DRIZZLED_API void my_error(error_t nr,
const Identifier&, myf MyFlags= MYF(0));
93 DRIZZLED_API void my_error(error_t nr, myf MyFlags, ...);
94 void my_message(error_t my_err,
const char *str, myf MyFlags);
95 void my_printf_error(error_t my_err,
const char *format,
97 __attribute__((format(printf, 2, 4)));