It's necessary in the way, with the debug in place, finding the root cause would have been much easier. Have modified str(e) to e.