feat: add status_code property on http error handling#1185
feat: add status_code property on http error handling#1185gcf-merge-on-green[bot] merged 6 commits intogoogleapis:masterfrom
Conversation
There was a problem hiding this comment.
Hi @wmarquardt ,
Thanks for submitting a PR! Could you please also update the getting started documentation here with an example?
We could replace the existing example with
try:
response = request.execute()
except HttpError as e:
print('Error response status code : {0}, reason : {1}'.format(e.status_code, e.error_details))
|
Unrelated to your changes, when I ran the example code I found that Change to |
parthea
left a comment
There was a problem hiding this comment.
Hi @wmarquardt ,
I missed this in the last review. Please could you also add a docstring in the new function?
|
Hi @parthea, Thank's for your review. I'll make these changes as soon as possible |
|
@busunkim96 , Please can you take a look? I was able to re-create the issue in #1255 where |
busunkim96
left a comment
There was a problem hiding this comment.
This looks OK to me @parthea but I am not very familiar with the code in errors.py. Is there something in particular you're concerned about?
🤖 I have created a release \*beep\* \*boop\* --- ## [2.1.0](https://www.github.com/googleapis/google-api-python-client/compare/v2.0.2...v2.1.0) (2021-03-31) ### Features * add status_code property on http error handling ([#1185](https://www.github.com/googleapis/google-api-python-client/issues/1185)) ([db2a766](https://www.github.com/googleapis/google-api-python-client/commit/db2a766bbd976742f6ef10d721d8423c8ac9246d)) ### Bug Fixes * Change default of `static_discovery` when `discoveryServiceUrl` set ([#1261](https://www.github.com/googleapis/google-api-python-client/issues/1261)) ([3b4f2e2](https://www.github.com/googleapis/google-api-python-client/commit/3b4f2e243709132b5ca41a3c23853d5067dfb0ab)) * correct api version in oauth-installed.md ([#1258](https://www.github.com/googleapis/google-api-python-client/issues/1258)) ([d1a255f](https://www.github.com/googleapis/google-api-python-client/commit/d1a255fcbeaa36f615cede720692fea2b9f894db)) * fix .close() ([#1231](https://www.github.com/googleapis/google-api-python-client/issues/1231)) ([a9583f7](https://www.github.com/googleapis/google-api-python-client/commit/a9583f712d13c67aa282d14cd30e00999b530d7c)) * Resolve issue where num_retries would have no effect ([#1244](https://www.github.com/googleapis/google-api-python-client/issues/1244)) ([c518472](https://www.github.com/googleapis/google-api-python-client/commit/c518472e836c32ba2ff5e8480ab5a7643f722d46)) ### Documentation * Distinguish between public/private docs in 2.0 guide ([#1226](https://www.github.com/googleapis/google-api-python-client/issues/1226)) ([a6f1706](https://www.github.com/googleapis/google-api-python-client/commit/a6f17066caf6e911b7e94e8feab52fa3af2def1b)) * Update README to promote cloud client libraries ([#1252](https://www.github.com/googleapis/google-api-python-client/issues/1252)) ([22807c9](https://www.github.com/googleapis/google-api-python-client/commit/22807c92ce754ff3d60f240ec5c38de50c5b654b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
self._get_reason is being called in \_\_init\_\_ (#1185) , so why not save it then? also in the \_\_repr\_\_ function we got the reason by calling the _get_reason function right in the beginning, but was then called again.
Fixes #1183 🦕
Fixes #1255 🦕