From b76054312d1784dfe0904ee956e7d80989dab996 Mon Sep 17 00:00:00 2001 From: William Marquardt Date: Fri, 12 Feb 2021 18:02:42 -0300 Subject: [PATCH 1/2] add status_code property on http error handling --- googleapiclient/errors.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/googleapiclient/errors.py b/googleapiclient/errors.py index 7163645ef70..49105675f0b 100644 --- a/googleapiclient/errors.py +++ b/googleapiclient/errors.py @@ -44,6 +44,10 @@ def __init__(self, resp, content, uri=None): self.uri = uri self.error_details = "" + @property + def status_code(self): + return self.resp.status + def _get_reason(self): """Calculate the reason for the error from the response content.""" reason = self.resp.reason From e53b5db574a527a7baa3e7f4acc4d7ae28fab682 Mon Sep 17 00:00:00 2001 From: William Marquardt Date: Fri, 12 Feb 2021 18:02:42 -0300 Subject: [PATCH 2/2] feat: add status_code property on http error handling --- googleapiclient/errors.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/googleapiclient/errors.py b/googleapiclient/errors.py index 7163645ef70..49105675f0b 100644 --- a/googleapiclient/errors.py +++ b/googleapiclient/errors.py @@ -44,6 +44,10 @@ def __init__(self, resp, content, uri=None): self.uri = uri self.error_details = "" + @property + def status_code(self): + return self.resp.status + def _get_reason(self): """Calculate the reason for the error from the response content.""" reason = self.resp.reason