The Python Oracle

When I catch an exception, how do I get the type, file, and line number?

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

--

Track title: CC C Schuberts Piano Sonata No 13 D

--

Chapters
00:00 Question
00:26 Accepted answer (Score 495)
00:40 Answer 2 (Score 297)
01:05 Answer 3 (Score 54)
02:48 Answer 4 (Score 49)
03:06 Thank you

--

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

Answer 2 links:
[Source]: http://jserv.sayya.org/misc/use_source_l...
[traceback.format_exception()]: http://hg.python.org/cpython/file/8dffb7...
[Read the Source]: http://catb.org/jargon/html/U/UTSL.html

--

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

--

Tags
#python #exception #stacktrace #traceback

#avk47