Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add exception handling to docs #1082

Closed
@mm326

Description

@mm326

Hi :)

I was reading the docs looking for an example to handle exceptions from when request.execute() goes wrong e.g. a 403 due to
Exceeding qouta limits.

I would like for the docs to be updated with a try: and except: like this

    try:
        response = request.execute()
    except HttpError as e:
        logger.error('Error response status code %d, reason %s:', e.resp.status, e.content)
        return {'error': 403, 'body' : 'YouTube API Data v3 qouta limit exceeded'}

or something else in the except block

If you're happy with this I'd like to contribute this as a first timer to open source?

Metadata

Metadata

Labels

type: docsImprovement to the documentation for an API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions