- Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
🚨This issue needs some love.This issue needs some love.triage meI really want to be triaged.I really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
This one should be pretty simple, I hope.
Here's the constructor signature: def __init__(self, reason, resp=None, content=None):
, which doesn't require resp
to be defined, and I can see it is not defined most of the time, for example, in googleapiclient/http.py.
Then, given the representation method:
def __repr__(self): return '<BatchError %s "%s">' % (self.resp.status, self.reason)
Which is also the string method:
__str__ = __repr__
This results in unprintable exceptions where resp
is undefined, which is not very helpful when attempting to understand the error (e.g. #164).
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.triage meI really want to be triaged.I really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.