Pedro Vale de Gato wrote:
> dabo Commit
> Revision 5137
> Date: 2009-03-19 13:07:28 -0700 (Thu, 19 Mar 2009)
> Author: Pedro.Gato
> Trac: http://trac.dabodev.com/changeset/5137
>
> Changed:
> U trunk/dabo/ui/uiwx/dControlItemMixin.py
>
> Log:
> If the correct key is not present in the list of keys the default behaviour
> was to raise an exception, which would result in semi-filled forms, log the
> error, but continue.
I think the correct behavior is to raise the exception. If the control is
getting set
to a Value that doesn't exist in the Keys, then something is wrong and the
exception
bluntly informs you of this.
If your UI wants to catch and ignore this exception, you can do it like this in
your
subclass:
def update(self, *args, **kwargs):
try:
self.super(*args, **kwargs)
except ValueError:
print "oops"
I've been inconvenienced by this exception too, believe me. But, I was getting
the
exception because I wasn't being careful enough in my code, so it was *good*
that I
was inconvenienced by it.
With this change, I'm never going to know when/if this happens again at a
client
site, and because their program will no longer stop at this exceptional
condition,
they may be working with corrupt data and never know it, my program won't know
it, etc.
When an unhandled exception happens in my programs, a nice UI is displayed to
the
user, they can enter notes, and I get a detailed email within minutes. Now I'll
never
know that it happened unless I want to write code to send me people's error
logs,
which I redirect to their user app directory.
How do others feel about this issue?
BTW, we were logging the error instead of raising the exception until fairly
recently
(6-8 months?).
The partially filled form happens because the exception wasn't caught, and the
wxPython event loop wasn't ended. I've always been a bit bothered by this
behavior...
perhaps we should do a sys.exit() after any exception to make sure the program
can't
continue, but that's a different issue.
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]