[PythonCAD] Seeking code suggestions when handling exceptions

Art Haas ahaas at airmail.net
Thu May 19 21:33:55 CEST 2005


On Thu, May 19, 2005 at 08:42:13AM -0500, Art Haas wrote:
> On Thu, May 19, 2005 at 07:32:04AM +0200, Noel Grandin wrote:
> > Hi
> > 
> > My basic suggestion is either
> > 
> > (a) don't do anything. If an exception happens you have already have a 
> > problem. A signal being lost is not such a big deal.
> 
> That is certainly an option. If the code isn't changed from its current
> form this is exactly what happens.

More reading and searching lead to the QT-mailing list archives.
The QT-interest list seemed most appropriate, so I did a search on
'exception handling' and found various threads which discuss this topic.
The thread below was very interesting and topicwise close to the
issue in PythonCAD about handling exceptions during sendMessage() calls:

http://lists.trolltech.com/qt-interest/2003-03/thread00680-0.html

Many of the points touched on in the thread are valid in PythonCAD - the
de-coupling of the entities sending and recieving the
signals(QT)/messages(PythonCAD), how an entity sending a signal/message
doesn't care how many listeners for that message have been connected,
and how notification can be viewed as a one-way message to something
like "My value has changed, deal with it". Also, the difficulty in
dealing with keeping track of which listeners have been sent a messsage
and trying to send another message telling them to ignore the earlier
one is brought up. Worth a look for people following this topic here.

Art
-- 
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822


More information about the PythonCAD mailing list