-
Notifications
You must be signed in to change notification settings - Fork 638
treat partial errors as callback(err)ors #1760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@callmehiphop PTAL |
packages/vision/src/index.js
Outdated
| .map(decorateAnnotations) | ||
| .filter(function(annotation) { | ||
| // Remove annotations that had errors. | ||
| return annotation; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/bigquery/src/table.js
Outdated
| * // recommendations on handling errors. | ||
| * // An API error or partial failure occurred. | ||
| * | ||
| * if (err.name === 'PartialFailureError') { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
dc9c83b to
368cde6
Compare
368cde6 to
bf50d79
Compare
bf50d79 to
8f0600d
Compare
|
Ready for a final sign off, @callmehiphop! |
packages/bigquery/src/table.js
Outdated
| * //- | ||
| * // Handling the response. | ||
| * //- | ||
| * function insertHandler(err, insertErrors, apiResponse) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/bigquery/src/table.js
Outdated
| * // recommendations on handling errors. | ||
| * // An API error or partial failure occurred. | ||
| * | ||
| * if (err.name === 'PartialFailureError') { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/bigquery/src/table.js
Outdated
| * | ||
| * // err.errors (object[]): | ||
| * // err.errors[].row (original row object passed to `insert`) | ||
| * // err.errors[].errors[].reason |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/bigquery/src/table.js
Outdated
| * // err.errors[].errors[].reason | ||
| * // err.errors[].errors[].message | ||
| * | ||
| * // See https://developers.google.com/bigquery/troubleshooting-errors for |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| it('should return partial errors', function(done) { | ||
| var data = { | ||
| name: 'dave', | ||
| breed: 'british shorthair', |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| * //- | ||
| * var callback = function(err, mutationErrors) { | ||
| * var callback = function(err) { | ||
| * if (err) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/vision/src/index.js
Outdated
| * if (detections.faces.errors.length > 0) { | ||
| * // Errors occurred while trying to use this image for a face annotation. | ||
| * if (err && err.name === 'PartialFailureError') { | ||
| * err.errors = [ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
PTAL! |
| it('should return partial errors', function(done) { | ||
| var data = { | ||
| name: 'dave', | ||
| breed: 'british husky', |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Fixes #1644
To Dos