The Python Oracle

Re-raise exception with a different type and message, preserving existing information

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: Hypnotic Orient Looping

--

Chapters
00:00 Question
02:02 Accepted answer (Score 301)
03:07 Answer 2 (Score 40)
03:54 Answer 3 (Score 16)
04:50 Answer 4 (Score 6)
06:28 Thank you

--

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

Question links:
[PEP 3134]: http://www.python.org/dev/peps/pep-3134/

Accepted answer links:
[PEP 3134]: http://www.python.org/dev/peps/pep-3134/
[knows how to report the exception's “cause” and “context”]: https://www.python.org/dev/peps/pep-3134...
[Ian Bicking]: http://blog.ianbicking.org/2007/09/12/re.../
[Ned Batchelder]: http://nedbatchelder.com/blog/200711/ret...

Answer 3 links:
[whichever exception]: http://docs.python.org/library/exception...
[this analysis]: http://blog.ianbicking.org/2007/09/12/re.../

--

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

--

Tags
#python #exceptionhandling #polymorphism

#avk47