On Mon, May 17, 2010 at 4:28 PM, Yann Ponty <
yann....@gmail.com> wrote:
>> Also -- I am not entirely sure if the "error" and "warning" params are
>> working. Shouldn't I get a error or warning message if I set the
>> wrong param, like when I set flat" to "1" instead of a boolean? Here
>> is an example...
>
> This one might arise from a slight inconsistency in the way we treat
> errors/warnings.
> Basically, VARNA used to throw exceptions around anytime something
> even remotely suspicious happened, and the warning/error params were
> just interpreted as "ignore warning" or "display a warning popup".
> As the code became more and more complicated, it gradually became
> harder (and almost impossible now) to stick to such a policy. Indeed,
> the exceptions must be thrown before any change is made, or at least
> at a moment which preserves a legal internal state for the applet,
> since we do not want the applet to crash afterward. Consequently, the
> current approach tends to silently ignore errors in input parameters
> and such...
> Another, maybe better, approach would consist in removing exceptions
> and add some sort of log where the errors/warnings would be
> displayed.
> These errors/warnings only seem to be helpful for debugging anyway, do
> you agree?
I am not entirely surely I follow you, although I probably would
understand this better if I looked at the code.
Let's not worry about the "error" and "warning" params. My only real
concern is that a clueless user such as myself may set illegal values
for other parameters -- e.g. wrong types (like my fumbling with "flat"
earlier), nonsensical values (like a non-existent layout algorithm
name provided as the "algorithm" param) and so forth. So, ideally,
the UI should tell the user that they specified an invalid config
somehow. I'm not particularly concerned about debugging VARNA, I just
want to be told when I misuse the program.
I'm basically asking for simple sanity checks. I am not asking for
extensive cross-referencing of all params to make sure the specified
state is correct/sensible, but just some simple type and value
checking. For example, when a param is drawn from a list of values
(e.g. naview, radiate, etc.), that you specified something that
belongs in the list and didn't make a typo. It would improve
usability by novices.
Cheers,
Andrew