23 #ifndef _LOAD_ERROR_HANDLER_HPP_ 24 #define _LOAD_ERROR_HANDLER_HPP_ 41 #if defined (SERVER_MODE) 49 template<
typename... Args>
58 template<
typename... Args>
61 template<
typename... Args>
64 template<
typename... Args>
67 template<
typename... Args>
70 template<
typename... Args>
73 template<
typename... Args>
97 template<
typename... Args>
98 static std::string
format (
const char *fmt, Args &&... args);
107 #if defined (SERVER_MODE) 111 bool is_error_filtered (
int err_id);
124 template<
typename... Args>
132 template<
typename... Args>
139 on_error (msg_id, std::forward<Args> (args)...);
146 template<
typename... Args>
158 template<
typename... Args>
169 template<
typename... Args>
180 on_failure (msg_id, std::forward<Args> (args)...);
191 template<
typename... Args>
196 int size = snprintf (
NULL, 0, fmt, std::forward<Args> (args)...) + 1;
197 std::unique_ptr<char[]> msg (
new char[size]);
199 snprintf (msg.get (), (size_t) size, fmt, std::forward<Args> (args)...);
201 return std::string (msg.get (), msg.get () + size - 1);
204 template<
typename... Args>
216 template<
typename... Args>
void on_syntax_failure(bool use_scanner_line=false)
bool current_line_has_error()
bool m_current_line_has_error
void log_date_time_conversion_error(Args &&...args)
static std::string format_log_msg(MSGCAT_LOADDB_MSG msg_id, Args &&...args)
static int fail(const char *message)
static char * get_message_from_catalog(MSGCAT_LOADDB_MSG msg_id)
void log_error_message(std::string &err_msg, bool fail, bool is_syntax_error=false)
void on_failure_with_line(MSGCAT_LOADDB_MSG msg_id, Args &&...args)
static std::string format(const char *fmt, Args &&...args)
void set_error_on_current_line(bool has_error)
void on_error_with_line(MSGCAT_LOADDB_MSG msg_id, Args &&...args)
bool is_last_error_filtered()
void on_error(MSGCAT_LOADDB_MSG msg_id, Args &&...args)