Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Make Details field extends GenericJson so that GoogleJsonError s…
…hould include any arbitrary error info from services (#2210)
- Loading branch information
Showing
6 changed files
with
173 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...ources/com/google/api/client/googleapis/json/errorResponseWithMultipleTypesInDetails.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"error": { | ||
"code": 400, | ||
"message": "The template parameters are invalid.", | ||
"status": "INVALID_ARGUMENT", | ||
"details": [ | ||
{ | ||
"@type": "type.googleapis.com/google.dataflow.v1beta3.InvalidTemplateParameters", | ||
"reason": "TEST REASON 1", | ||
"parameterViolations": [ | ||
{ | ||
"parameter": "safeBrowsingApiKey", | ||
"description": "Parameter didn't match regex '^[0-9a-zA-Z_]+$'" | ||
} | ||
] | ||
}, | ||
{ | ||
"@type": "type.googleapis.com/google.rpc.DebugInfo", | ||
"detail": "test detail" | ||
}, | ||
{ | ||
"@type": "type.googleapis.com/google.rpc.DebugInfo", | ||
"reason": "test reason 2" | ||
}, | ||
{ | ||
"@type": "type.googleapis.com/google.rpc.BadRequest", | ||
"fieldViolations": [ | ||
{ | ||
"field": "language_code", | ||
"description": "Field is required" | ||
} | ||
] | ||
}, | ||
{ | ||
"@type": "type.googleapis.com/google.chrome.policy.v1.PolicyModificationErrorDetails", | ||
"modificationErrors": [ | ||
{ | ||
"policyTargetKey": { | ||
"targetResource": "orgunits/03ph8a2z19ryqq8" | ||
}, | ||
"policySchema": "chrome.users.BrowserThemeColor", | ||
"fieldErrors": [ | ||
{ | ||
"field": "browserThemeColor", | ||
"error": "Field is an invalid hex color. Only the numbers 0-9 and letters A-F are permitted." | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"@type": "type.googleapis.com/google.mybusiness.v4.ValidationError", | ||
"errorDetails": [ | ||
{ | ||
"code": 3, | ||
"field": "regular_hours.periods.close_time", | ||
"message": "Time field must follow hh:mm format.", | ||
"value": "25:00" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
|
63 changes: 63 additions & 0 deletions
63
.../com/google/api/client/googleapis/json/expectedParsedErrorWithMultipleTypesInDetails.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"code": 400, | ||
"message": "The template parameters are invalid.", | ||
"status": "INVALID_ARGUMENT", | ||
"details": [ | ||
{ | ||
"@type": "type.googleapis.com/google.dataflow.v1beta3.InvalidTemplateParameters", | ||
"reason": "TEST REASON 1", | ||
"parameterViolations": [ | ||
{ | ||
"parameter": "safeBrowsingApiKey", | ||
"description": "Parameter didn't match regex '^[0-9a-zA-Z_]+$'" | ||
} | ||
] | ||
}, | ||
{ | ||
"@type": "type.googleapis.com/google.rpc.DebugInfo", | ||
"detail": "test detail" | ||
}, | ||
{ | ||
"@type": "type.googleapis.com/google.rpc.DebugInfo", | ||
"reason": "test reason 2" | ||
}, | ||
{ | ||
"@type": "type.googleapis.com/google.rpc.BadRequest", | ||
"fieldViolations": [ | ||
{ | ||
"field": "language_code", | ||
"description": "Field is required" | ||
} | ||
] | ||
}, | ||
{ | ||
"@type": "type.googleapis.com/google.chrome.policy.v1.PolicyModificationErrorDetails", | ||
"modificationErrors": [ | ||
{ | ||
"policyTargetKey": { | ||
"targetResource": "orgunits/03ph8a2z19ryqq8" | ||
}, | ||
"policySchema": "chrome.users.BrowserThemeColor", | ||
"fieldErrors": [ | ||
{ | ||
"field": "browserThemeColor", | ||
"error": "Field is an invalid hex color. Only the numbers 0-9 and letters A-F are permitted." | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"@type": "type.googleapis.com/google.mybusiness.v4.ValidationError", | ||
"errorDetails": [ | ||
{ | ||
"code": 3, | ||
"field": "regular_hours.periods.close_time", | ||
"message": "Time field must follow hh:mm format.", | ||
"value": "25:00" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters