SeattleTestbed / seash

Interactive vessel management tool
MIT License
0 stars 10 forks source link

raise must use unique strings #64

Open choksi81 opened 10 years ago

choksi81 commented 10 years ago

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.

choksi81 commented 10 years ago

See also seattlelib_v2's issue #129, nodemanager's issue #82 and repy_v2's issue #66

choksi81 commented 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")

choksi81 commented 10 years ago

Sounds good. At times I believe adding a bit of information (callargs etc.) will also help, cf. #1293.