[MERGE] dont stacktrace on bad plugin versions
Forest Bond
forest at alittletooquiet.net
Thu Oct 16 11:46:28 BST 2008
Hi,
On Thu, Oct 16, 2008 at 11:35:08AM +1100, Andrew Bennetts wrote:
> Marius Kruger wrote:
> [...]
> > I found code in server.py like:
> >
> > try:
> > ...
> > except KeyboardInterrupt:
> > raise
> > except Exception, e:
> > trace.log_exception_quietly()
> >
> > will that be ok?
> > is there any others we should ignore?
>
> SystemExit and MemoryError are the other likely ones I'd catch.
>
> Also, remember that “except Exception:” is often better than a bare
> “except:” because in 2.5 and later “except Exception” won't catch
> absolutely everything, and that's usually what you want. (Look at the
> docs regarding BaseException vs. Exception).
More generally, I have to wonder: does _format_version_tuple really raise any of
an infinite variety of exceptions? It's almost always preferable to specify the
exceptions that are possible rather than specifying those that you don't want to
handle.
-Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20081016/4d592906/attachment-0001.pgp
More information about the bazaar
mailing list