Open choksi81 opened 10 years ago
I will tag each raise with the name of the calling function/method to ensure uniqueness. i.e. def myfunction(): raise Exception("myfunction failed: error string here")
class myclass: def myfunction(): raise Exception(myclass.myfunction failed: error string here")
Sounds good. At times I believe adding a bit of information (callargs etc.) will also help, cf. #1293.
We often
raise
exceptions in our code and accompany them with an explanation in string form. Alas, the string isn't always unique, so it doesn't point to the place where the exception was raised, but multiple possible places.We absolutely must raise unique strings, or they are not helpful for debugging! Let's
grep -r raise | sort | uniq -d
the sources and fix stuff up.