[Piglit] [PATCH 2/2] framework: Provide more helpful error message when loading results fails

Brian Paul brianp at vmware.com
Fri Nov 4 23:02:38 UTC 2016


On 11/04/2016 02:49 PM, Dylan Baker wrote:
> Quoting Brian Paul (2016-11-04 13:18:21)
>> On 11/04/2016 01:49 PM, Dylan Baker wrote:
> [snip]
>>
>> This works, but
>> 1. seems like a lot of duplicated code.
>> 2. How about a simpler error message like: "Unable to open '%s'"
>
> But that's not the problem. The function that it's failing in is responsible for
> deciding which backend to send the file to to be opened, not opening the file
> itself. That message would make me think that the file was corrupt, or invalid
> JSON, not that I'd typoed the file extension or pointed at the wrong directory.
>
> What about: "unknown file extension '%s'"?

Ah, OK.  When I try "nonexistant.json.bz2" I get "No such file or 
directory".

I guess I'd like to see that message if the input file doesn't exist, 
regardless of extension.  But if the file does exist and its type isn't 
recognized, report something like "unknown file type/extension".

Does that seem reasonable?  That's kind of what gcc does.

-Brian



More information about the Piglit mailing list