Exceptional Conditions: Regular Toronto Python User's group on Tuesday
Mike C. Fletcher
mcfletch at vrplumber.com
Wed Aug 12 06:25:32 CEST 2009
We'll have our regular Toronto Python User's Group (PyGTA) meeting on
Tuesday the 18th of August. This month's topic:
Exceptional Conditions: when to ignore, assert, raise, log, except,
or email?
When programming in Python, we often run into situations which are
not "normal" or expected. Python allows you to deal with these
situations in any number of different ways:
* ignoring the error (letting a lower-level library raise an
exception)
* asserting an assumption (raising a generic error that says
something shouldn't have happened)
* raising an explicit error
* returning a "success" flag with your "real" return value
* providing finally/context-manager operations (unconditional
cleanup)
* logging the exceptional condition and continuing
* logging the condition into a database
* sending a syslog message
* catching a particular error and ignoring
* catching all errors and ignoring
* displaying a nice error message to the user
* emailing a user
In our round-table on Tuesday we'll try to hash out when/where/why
you would choose any or all of these approaches. Do you have coding
standards that make exceptional conditions un-exceptional? Do you
have tools you use to make logs more useful? Do you have a
rule-of-thumb you apply to choose an approach? Are there different
requirements for GUI versus Web applications? What about
embedded/appliance applications? How much information should a user
be given about a failure condition? We'll look at the various tools
available and how to use them as well.
We'll meet at our regular time and location, Linux Caffe at 7:10pm.
http://www.pygta.org
BTW, we're looking for speakers and/or topics for September, October and
beyond. We're particularly interested in new-user friendly topics that
can help the (large) new crop of Pythonistas advance quickly. Email me
with your suggestions or ideas, or bring them up at the meeting.
Hope to see you on Tuesday,
Mike
--
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com
More information about the Python-announce-list
mailing list