Skip to content
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

Merged
merged 12 commits into from
Nov 7, 2016

Conversation

stephenplusplus
Copy link
Contributor

@stephenplusplus stephenplusplus commented Oct 31, 2016

Fixes #1644

To Dos

@stephenplusplus stephenplusplus added api: bigquery Issues related to the BigQuery API. don't merge api: bigtable Issues related to the Bigtable API. api: vision Issues related to the Cloud Vision API. labels Oct 31, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 31, 2016
@stephenplusplus
Copy link
Contributor Author

@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.

This comment was marked as spam.

* // 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.

This comment was marked as spam.

This comment was marked as spam.

@stephenplusplus stephenplusplus added status: blocked Resolving the issue is dependent on other work. and removed don't merge labels Nov 2, 2016
@stephenplusplus stephenplusplus removed the status: blocked Resolving the issue is dependent on other work. label Nov 7, 2016
@stephenplusplus
Copy link
Contributor Author

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.

* // 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.

*
* // 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.

* // err.errors[].errors[].reason
* // err.errors[].errors[].message
*
* // See https://developers.google.com/bigquery/troubleshooting-errors for

This comment was marked as spam.

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.

*
* @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.

* 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.

This comment was marked as spam.

@stephenplusplus
Copy link
Contributor Author

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.

This comment was marked as spam.

This comment was marked as spam.

@callmehiphop callmehiphop merged commit b6270e5 into googleapis:master Nov 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. api: bigtable Issues related to the Bigtable API. api: vision Issues related to the Cloud Vision API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants