Quite simply, you need to wrap statements that could fail in try/apart from as precise as is possible, in quite possibly the most internal-loop as you possibly can. Share Improve this solution Follow You need the traceback module. It is going to Enable you to print stack dumps like Python https://thejillist.com/story10486269/weed-in-belfast-things-to-know-before-you-buy