docs: Change error parsing to check for 'message' (#1083)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/google-api-python-client/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
Fixes #1082 🦕
diff --git a/docs/start.md b/docs/start.md
index ceac5dd..5efdcad 100644
--- a/docs/start.md
+++ b/docs/start.md
@@ -94,7 +94,10 @@
Creating a request does not actually call the API. To execute the request and get a response, call the `execute()` function:
```python
-response = request.execute()
+try:
+ response = request.execute()
+except HttpError as e:
+ print('Error response status code : {0}, reason : {1}'.format(e.resp.status, e.error_details))
```
Alternatively, you can combine previous steps on a single line: