Re: X error messages



Havoc Pennington <hp redhat com> writes:

> Hi,
> 
> This is fairly self-explanatory. Changes the message on X error to be
> less totally mysterious and get people started debugging it. Changes
> the "X server shut down" error to be more end-user-friendly.

Looks mostly like a good improvement:

> +static const gchar*
> +request_name (gint request_code)
> +{
> +
> +  switch (request_code)
> +    {
> +    case 1:
> +      return "X_CreateWindow";
> +      break;

Hmmm, it would be possible to use /usr/lib/X11/XErrorDB to get this information,
and even possibly handle extension codes requests; but it perhaps is not
worth the effort as compared to hard-coding it.

But do you think having the request name here is really worth the cost of all
these strings, since it is minimally useful without a --sync backtrace?

>  	  XGetErrorText (display, error->error_code, buf, 63);
>  
> +          msg = g_strdup_printf ("The program '%s' received an X Window System error.\nThis probably reflects a bug in the program.\n"
> +                                 "The error was '%s' and occurred due to a '%s' request.\n"
> +                                 "  (Details: serial %ld error_code %d request_code %d minor_code %d\n"
> +                                 "  (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it.\n",

Probably should break this at 80 columns.

> -      fprintf (stderr, "Gdk-ERROR **: X connection to %s broken (explicit kill or server shutdown).\n", gdk_display ? DisplayString (gdk_display) : gdk_get_display());
> +      fprintf (stderr, "The application '%s' lost its connection to the X server %s; most likely the X server was shut down.\n",

I think it is important to leave a reference here to the fact that this may be as an
explicit kill (xkill or more likely, through the window manager.) Not quite sure
how to phrase this.

Regards,
                                                      Owen




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