Addressing #107, add safety checks to verify that the passed parameter of nomad_resp is a requests.Response object if it is not cast str around exception with different message.
Not a huge fan of have a conditional str with different messages (along with checking for certain substrings as a test) but this should at least fix the bug and ensure somewhat backwards compatibility. Technically text in requests.Response is not a guarantee either since its kwargs are popped for response and request and can possibly be None.
If we do eventually move to python 3+ only support adding annotations should help a bunch when visually inspecting or even mypy level runtime checking.
Addressing #107, add safety checks to verify that the passed parameter of
nomad_resp
is arequests.Response
object if it is not cast str around exception with different message.Not a huge fan of have a conditional str with different messages (along with checking for certain substrings as a test) but this should at least fix the bug and ensure somewhat backwards compatibility. Technically
text
in requests.Response is not a guarantee either since its kwargs are popped for response and request and can possibly beNone
.If we do eventually move to python 3+ only support adding annotations should help a bunch when visually inspecting or even mypy level runtime checking.