h
h copied to clipboard
ValueError: :userid isn't a valid userid
Sentry Issue: H-1QA
ValueError: :userid isn't a valid userid
(7 additional frame(s) were not displayed)
...
File "pyramid/router.py", line 128, in handle_request
tdict = traverser(request)
File "pyramid/traversal.py", line 730, in __call__
next = getitem(segment)
File "h/traversal/roots.py", line 286, in __getitem__
user = self.user_svc.fetch(userid)
File "h/services/user.py", line 59, in fetch
parts = split_user(userid)
File "h/util/user.py", line 18, in split_user
raise ValueError("{userid} isn't a valid userid".format(userid=userid))
I believe this is a fix for this: https://github.com/hypothesis/h/pull/5760 — just need time to get back to finishing up that PR. Anyone else is welcome to take this.
Oh noes... I've also fixed this in a different way in:
https://github.com/hypothesis/h/pull/5819
@jon-betts I've no attachment whatsoever to my (inelegant) fix. Please feel free to close mine and use yours.
@lyzadanger Well I suppose it's mostly a learning exercise. The fact I ended up with a fix in the same place in the code is a good thing!
I want to see if I can get it to work with a specific error, as raising ValueError
here scares me a bit.