Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

errors.py: Add support for JSON content that has errors instead of detail or details #1279

Copy link
Copy link
Closed
@vinay-google

Description

@vinay-google
Issue body actions

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Is your feature request related to a problem? Please describe.

We have been using errors.py to raise HttpError errors. Unfortunately, many of our instances have content that matches the following format:

{
  error: {
    errors: {
    }
  }
}

versus what _get_reason is looking for i.e. only one of detail, details, or message
This results us seeing the errors being logged but not the details:

<HttpError 503 when requesting url returned "Internal error. Please try again.">

Describe the solution you'd like

The solution involves modifying _get_reason to also support error_detail_keyword with an additional value of errors. This modifies the order to: detail, details, errors, message

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.