-
Notifications
You must be signed in to change notification settings - Fork 592
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
treat partial errors as callback(err)ors #1760
Conversation
@callmehiphop PTAL |
.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.
* // 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! |
@@ -1015,18 +1015,19 @@ Table.prototype.import = function(source, metadata, callback) { | |||
* //- | |||
* 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.
* // 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.
* | ||
* // 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.
* // 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.
* | ||
* @example | ||
* //- | ||
* // Insert entities. See {module:bigtable/table#insert} | ||
* //- | ||
* 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.
* 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