Bug 692604

Summary: error message is nonsense when option value is invalid
Product: Ghostscript Reporter: matteosistisette
Component: GeneralAssignee: Ray Johnston <ray.johnston>
Status: RESOLVED FIXED    
Severity: enhancement CC: alex
Priority: P4    
Version: 9.04   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---

Description matteosistisette 2011-10-16 22:11:12 UTC
I happened to write by mistake:

-dGraphicsAlphaBits=4 -dTextAlphaBit=n

with a literal 'n' instead of replacing it with a number.

The error message that I got was:

-dvar=name requires name=null, true, or false

This error message doesn't make any sense to the user.

A correct error message would be something like 
"invalid value 'n' for option -dTextAlphaBit"

Note there are two issues:
1. the error message doesn't make sense to the user (why null, true or false?) (I do understand, I guess, where this comes from, but this is too low-level)
2. it doesn't tell you WHICH option it is complaining about.

Issue 2 is very important too. I spent several minutes staring at the -dGraphicsAlphaBit=4 and wondering what was wrong with the 4.
Comment 1 Alex Cherepanov 2012-08-24 23:23:07 UTC
A patch that improves error messages has been committed as a rev:
http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=d840d02d5fd655c397b08e01a273a4e4e757f96e