[PATCH wayland] server: give more precise error message

Bill Spitzak spitzak at gmail.com
Thu Mar 19 11:32:15 PDT 2015



On 03/19/2015 12:42 AM, Marek Chalupa wrote:

>   		message = &object->interface->methods[opcode];
> +		since = wl_message_get_since(message);
>   		if (!(resource_flags & WL_MAP_ENTRY_LEGACY) &&
> -		    resource->version > 0 &&
> -		    resource->version < wl_message_get_since(message)) {
> +		    resource->version > 0 && resource->version < since) {
>   			wl_resource_post_error(client->display_resource,
>   					       WL_DISPLAY_ERROR_INVALID_METHOD,
> -					       "invalid method %d, object %s@%u",
> -					       opcode,
> +					       "invalid method %d (since %d < %d)"
> +					       ", object %s@%u",
> +					       opcode, resource->version, since,
>   					       object->interface->name,
>   					       object->id);
>   			break;

Might help to put the word "versions" or a 'v' in there.

Perhaps the output could look like

   invalid method 22. object blah at 1231223 v17 (v18 required)


More information about the wayland-devel mailing list