~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/error.cc

  • Committer: Olaf van der Spek
  • Date: 2011-02-23 00:39:48 UTC
  • mto: (2197.1.2 build) (2209.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2198.
  • Revision ID: olafvdspek@gmail.com-20110223003948-u7hv60z4avbxwr83
Add find_ptr

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <drizzled/definitions.h>
28
28
#include <drizzled/error.h>
29
29
#include <drizzled/gettext.h>
30
 
 
31
30
#include <drizzled/identifier.h>
 
31
#include <drizzled/find_ptr.h>
32
32
 
33
33
#include <boost/unordered_map.hpp>
34
34
#include <exception>
284
284
 
285
285
const std::string &ErrorMap::find(drizzled::error_t error_num) const
286
286
{
287
 
  ErrorMessageMap::const_iterator pos= mapping_.find(error_num);
288
 
  if (pos == mapping_.end())
 
287
  const ErrorMessageMap::mapped_type* pos= find_ptr(mapping_, error_num);
 
288
  if (!pos)
289
289
  {
290
290
    throw ErrorStringNotFound();
291
291
  }
292
 
  return pos->second.second;
 
292
  return pos->second;
293
293
}
294
294
 
295
295
#define ADD_ERROR_MESSAGE(code, msg) add(code, STRINGIFY_ARG(code), msg)