Skip to content

Commit 6398a54

Browse files
add error handling example
1 parent 7500924 commit 6398a54

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/vision/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,15 @@ Vision.prototype.annotate = function(requests, callback) {
269269
* // }
270270
* // ]
271271
* });
272+
*
273+
* //-
274+
* // To handle errors that occurred, check the length of the `errors` array.
275+
* //-
276+
* vision.detect('malformed-image.jpg', types, function(err, detections) {
277+
* if (detections.faces.errors.length > 0) {
278+
* // Errors occurred while trying to use this image for a face annotation.
279+
* }
280+
* });
272281
*/
273282
Vision.prototype.detect = function(images, options, callback) {
274283
var self = this;

0 commit comments

Comments
 (0)