This repository was archived by the owner on Jul 3, 2020. It is now read-only.
Changed error result with response_metadata field#142
Open
shollingsworth wants to merge 1 commit intoos:masterfrom
Open
Changed error result with response_metadata field#142shollingsworth wants to merge 1 commit intoos:masterfrom
shollingsworth wants to merge 1 commit intoos:masterfrom
Conversation
…th more context Turns response.error variable from: `Error: validation_errors` to `Error: validation_errors - [ERROR] Element 2 field `label` cannot be longer than 24 characters` if the response JSON body has a field `response_metadata` that is not empty.
os
reviewed
Feb 9, 2020
Comment on lines
+51
to
+55
| if self.response_metadata: | ||
| self.error = '{} - {}'.format( | ||
| self.error, | ||
| ','.join(self.response_metadata.get('messages')), | ||
| ) |
Owner
There was a problem hiding this comment.
I prefer not to modify the error field. I'm happy to merge it once you remove this bit.
| self.body = json.loads(body) | ||
| self.successful = self.body['ok'] | ||
| self.error = self.body.get('error') | ||
| self.response_metadata = self.body.get('response_metadata') |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed error result with response_metadata field set to something with more context
Turns response.error variable from:
Error: validation_errorsto
Error: validation_errors - [ERROR] Element 2 field 'label' cannot be longer than 24 charactersif the response JSON body has a field
response_metadatathat is not empty.