The Python Oracle

Exception handling when errors may occur in main program or in cleanup

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Dreamlands

--

Chapters
00:00 Question
04:45 Accepted answer (Score 4)
07:00 Answer 2 (Score 1)
08:26 Answer 3 (Score 0)
09:41 Thank you

--

Full question
https://stackoverflow.com/questions/8698...

Question links:
[Re-raising Exceptions]: http://blog.ianbicking.org/2007/09/12/re.../
[srgerg's answer]: https://stackoverflow.com/a/8699141/3507...
[PEP 343]: http://www.python.org/dev/peps/pep-0343/
[Context Manager Types]: http://docs.python.org/library/stdtypes....
[The with statement]: http://docs.python.org/reference/compoun...
http://docs.python.org/reference/datamod...
[Context Manager Types]: http://docs.python.org/library/stdtypes....
[srgerg's answer]: https://stackoverflow.com/a/8699141/3507...

Accepted answer links:
[with statement]: http://www.python.org/dev/peps/pep-0343/

Answer 2 links:
[exception hook]: http://docs.python.org/library/sys.html#...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #exceptionhandling

#avk47