You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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")
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.The text was updated successfully, but these errors were encountered: