[MERGE] dont stacktrace on bad plugin versions

John Arbash Meinel john at arbash-meinel.com
Thu Oct 16 02:58:01 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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).
> 
> -Andrew.
> 
> 
> 

As we are only worried about what "_format_version" is going to raise, I
would just trap ValueError, TypeError, and IndexError and let everything
else pass through.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkj2n6kACgkQJdeBCYSNAANK3wCfXo3nf8dkTWy165VDvqEBjVRQ
mE4An2kZN7pMhJX9iKYiQuB/cWsy/Hls
=8uND
-----END PGP SIGNATURE-----



More information about the bazaar mailing list