[Tutor] Logging exceptions, but getting stderr output instead
Alan Gauld
alan.gauld at yahoo.co.uk
Wed May 25 15:37:36 EDT 2016
On 25/05/16 19:11, Alex Hall wrote:
> As a quick aside, is there an easy way to halt script execution for some
> exceptions? Right now, catching them means that execution continues, but I
> sometimes want to log the problem and then abort the script, as the error
> means it shouldn't continue. Thanks.
I'm not sure what the issue is here.
Can't you just exit in the normal fashion using
sys.exit()
or
raise SystemExit?
I feel I must be missing something?
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
More information about the Tutor
mailing list