Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raise must use unique strings #64

Open
choksi81 opened this issue May 29, 2014 · 3 comments
Open

raise must use unique strings #64

choksi81 opened this issue May 29, 2014 · 3 comments
Assignees

Comments

@choksi81
Copy link
Contributor

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
Copy link
Contributor Author

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

@choksi81
Copy link
Contributor Author

choksi81 commented Jun 2, 2014

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
Copy link
Contributor Author

choksi81 commented Jun 2, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants