-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
🚨This issue needs some love.This issue needs some love.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.status: acknowledgedtype: 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.
Description
Run some code that makes an invalid request.
File "/home/user/.local/lib/python2.7/site-packages/googleapiclient/http.py", line 840, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://appengine.googleapis.com/v1/apps/<project>/services/default?alt=json returned "Invalid request.">Now when you get the exception and its content the error becomes slightly more verbose.
{
"error": {
"code": 400,
"message": "Invalid request.",
"errors": [
{
"message": "Invalid request.",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}Making the same request manually to the REST API returns a significantly more useful response.
{
"error": {
"code": 400,
"message": "Invalid request.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "service.split.allocations[1]",
"description": "Allocation must be a value in the range (0, 1]."
},
{
"field": "service.split.allocations",
"description": "Traffic allocations must sum to 1."
}
]
}
]
}
}Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.status: acknowledgedtype: 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.