~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/error.cc

  • Committer: Brian Aker
  • Date: 2011-01-16 20:38:08 UTC
  • mto: (2088.1.1 merge)
  • mto: This revision was merged to the branch mainline in revision 2089.
  • Revision ID: brian@gir-3-20110116203808-dl1dvpoarmkug1no
Entire convert over to time_t.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
  return get_error_map().mapping_;
59
59
}
60
60
 
61
 
void add_error_message(uint32_t error_code,
 
61
void add_error_message(drizzled::error_t error_code,
62
62
                       const std::string &error_name,
63
63
                       const std::string &message)
64
64
{
65
65
  get_error_map().add(error_code, error_name, message);
66
66
}
67
67
 
68
 
const char * error_message(unsigned int code)
 
68
const char * error_message(drizzled::error_t code)
69
69
{
70
70
  try
71
71
  {
141
141
      ...       variable list
142
142
*/
143
143
 
144
 
void my_printf_error(uint32_t error, const char *format, myf MyFlags, ...)
 
144
void my_printf_error(drizzled::error_t error, const char *format, myf MyFlags, ...)
145
145
{
146
146
  va_list args;
147
147
  char ebuff[ERRMSGSIZE+20];
150
150
  (void) vsnprintf (ebuff, sizeof(ebuff), format, args);
151
151
  va_end(args);
152
152
  (*error_handler_hook)(error, ebuff, MyFlags);
153
 
  return;
154
153
}
155
154
 
156
155
/*
163
162
      MyFlags   Flags
164
163
*/
165
164
 
166
 
void my_message(uint32_t error, const char *str, register myf MyFlags)
 
165
void my_message(drizzled::error_t error, const char *str, register myf MyFlags)
167
166
{
168
167
  (*error_handler_hook)(error, str, MyFlags);
169
168
}
171
170
 
172
171
// Insert the message for the error.  If the error already has an existing
173
172
// mapping, an error is logged, but the function continues.
174
 
void ErrorMap::add(uint32_t error_num,
 
173
void ErrorMap::add(drizzled::error_t error_num,
175
174
                   const std::string &error_name,
176
175
                   const std::string &message)
177
176
{
186
185
  }
187
186
}
188
187
 
189
 
const std::string &ErrorMap::find(uint32_t error_num) const
 
188
const std::string &ErrorMap::find(drizzled::error_t error_num) const
190
189
{
191
190
  ErrorMessageMap::const_iterator pos= mapping_.find(error_num);
192
191
  if (pos == mapping_.end())