Re: GDK error codes



"Timothy M. Shead" <tshead k-3d com> writes:
> One of my users gets the following when running an application using GTK+ 1.2, and
> I'm wondering what the meanings of the error codes are; not so much what these
> specific codes are, but what they represent, so I know where to look them up in the
> future.
> 
> Gdk-ERROR **: BadFont (invalid Font parameter)
>    serial 23366 error_code 7 request_code 143 minor_code 12
> 

These are from Xlib. The components are:
 serial:  each time you make an X request the current serial 
          is incremented. serial numbers appear in events.

 error_code: the type of error, e.g. BadMatch or BadFont. 
           See /usr/include/X11/X.h for the list

 request_code: what sort of X request was made, e.g.
              CreateWindow request, QueryTree request, etc.
              (see /usr/include/X11/Xproto.h, or the 
              X protocol spec or book)

 minor_code: I believe each X extension has a request_code 
             and then specific requests supported by the extension 
             are suppoted by the minor code. I could be wrong.

See "man XErrorEvent"

Anyhow, none of this matters much except the error code; follow the 
advice from the revised version of the error message in GTK 2:

  msg =
            g_strdup_printf ("The program '%s' received an X Window System error.\n"
                             "This probably reflects a bug in the program.\n"
                             "The error was '%s'.\n"
                             "  (Details: serial %ld error_code %d request_code %d minor_code %d)\n"
                             "  (Note to programmers: normally, X errors are reported asynchronously;\n"
                             "   that is, you will receive the error a while after causing it.\n"
                             "   To debug your program, run it with the --sync command line\n"
                             "   option to change this behavior. You can then get a meaningful\n"
                             "   backtrace from your debugger if you break on the gdk_x_error() function.)",
                             g_get_prgname (),
                             buf,
                             error->serial, 
                             error->error_code, 
                             error->request_code,
                             error->minor_code);

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]