28#include <drizzled/errmsg_print.h>
29#include <drizzled/plugin/error_message.h>
37void sql_perror(
const char *message)
40 char errmsg[STRERROR_MAX];
43 errmsg_ptr= strerror_r(errno, errmsg,
sizeof(errmsg));
45 errmsg_printf(error::ERROR,
"%s: %s\n", message, errmsg_ptr);
50void sql_perror(
const std::string &message)
52 static std::string empty;
53 sql_perror(message, empty);
57void sql_perror(std::string message,
const std::string &extra)
60 char errmsg[STRERROR_MAX];
63 errmsg_ptr= strerror_r(errno, errmsg,
sizeof(errmsg));
65 if (not extra.empty())
67 if (message.at(message.size()-1) !=
' ')
75 errmsg_printf(error::ERROR,
"%s: %s\n", message.c_str(), errmsg_ptr);
78bool errmsg_printf(error::priority_t priority,
char const *format, ...)
82 va_start(args, format);
83 rv= plugin::ErrorMessage::vprintf(priority, format, args);
TODO: Rename this file - func.h is stupid.