From: Jasper St. Pierre Date: Wed, 13 Nov 2013 02:44:37 +0000 (-0500) Subject: wayland-server: Improve error messages for bad globals X-Git-Tag: 1.3.91~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=40d057f2c90eaeffd6185078b25a0e0ff861f2a8;p=platform%2Fupstream%2Fwayland.git wayland-server: Improve error messages for bad globals A bug in Weston's toytoolkit gave me an hour of debugging headaches. Improve the error messages that we send if a client requests an invalid global, either by name or by version. --- diff --git a/src/wayland-server.c b/src/wayland-server.c index e04d2f4..80e76e1 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -701,11 +701,15 @@ registry_bind(struct wl_client *client, if (global->name == name) break; - if (&global->link == &display->global_list || - global->version < version) + if (&global->link == &display->global_list) wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT, - "invalid global %d", name); + "invalid global %s (%d)", interface, name); + else if (global->version < version) + wl_resource_post_error(resource, + WL_DISPLAY_ERROR_INVALID_OBJECT, + "invalid version for global %s (%d): have %d, wanted %d", + interface, name, global->version, version); else global->bind(client, global->data, version, id); }