Xlib - reporting X errors [+patches]

Lubos Lunak l.lunak at suse.cz
Wed Mar 18 07:30:58 PDT 2009


On Tuesday 17 of March 2009 02:12:37 Alan Coopersmith wrote:
> Lubos Lunak wrote:
> >  As a small help, I suggest also applying the ErrDes_2.c.patch file, that
> > makes XGetErrorText() print the error number at least with the extension
> > name, in case the error message is missing in XErrorDB again. There is
> > unfortunately no XGetRequestText() that would print request name for
> > given opcode, and XGetErrorDatabaseText() requires extension name passed.

> I was going through old patch mail and see this never got handled - sorry
> about that, we've not been good at always staying on top of our incoming
> patch queue.
>
> I've pushed the first change to XGetErrorText() as is, and pushed the
> portions of the XErrorDB patch that weren't already in git - thanks for
> those.    I'm not pushing the second XGetErrorText() patch as it seems
> redundant to the if (!buffer[0] && bext) {
> case just above it - is there something I'm missing there?

 See above. I don't really remember anymore, but I think in the case of an 
error missing in XErrorDB XGetErrorDatabaseText() returns the (empty) default.

> I agree we need to think more about our error handlers and allowing
> replacements to get the information out of Xlib that it already has - it
> might help avoid things like the abomination that is the gtk error handler,
> which swallows up useful information like which extension the error was hit
> in, just so it can print a longer and more useless error message than the
> Xlib default one.

 I think it might be enough to just make Xlib export a function that would 
provide the error message for XErrorEvent (i.e. factor out the code from the 
default Xlib handler into this function).

-- 
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o.   e-mail: l.lunak at suse.cz , l.lunak at kde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http://www.suse.cz




More information about the xorg mailing list