Hi Jay,

> Can we make the error system flexible enough so that an error code can 
> be mapped to multiple error messages and called appropriately depending 
> on the calls made to the server?

When I was first thinking about this problem with the drizzle client
several weeks ago I came up with this quick mock-up:

enum errcodes {
MYERRA = 1000,
MYERRB
};

enum level {
ERR_CRITICAL,
ERR_WARNING
};

typedef struct errors {
  enum errcodes err_code;
  uint32_t err_count;
  const char* errmsg;
  enum level err_level;
} ERRMSG;

static ERRMSG my_error[] = {
{ MYERRA, 0, "An error\n", ERR_CRITICAL },
{ MYERRA, 1, "Another error with code MYERRA\n", ERR_CRITICAL },
{ MYERRB, 0, "A Warning\n", ERR_WARNING }};

I know we are looking for something much nicer/cleaner but it may
inspire ideas.

Kind Regards
-- 
Andrew Hutchings
MySQL Support Engineer
Sun Microsystems, Inc.
http://www.sun.com/mysql/


_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to