@@ -371,9 +371,9 @@ describe('retryable', function() {
371
371
var spy = sinon . spy ( fail ) ;
372
372
var apiCall = createApiCall ( spy , settings ) ;
373
373
apiCall ( null , null , function ( err , resp ) {
374
- expect ( err ) . to . be . ok ;
375
- expect ( err . cause ) . to . be . an ( 'error' ) ;
376
- expect ( err . cause . code ) . to . eq ( FAKE_STATUS_CODE_1 ) ;
374
+ expect ( err ) . to . be . an ( 'error' ) ;
375
+ expect ( err . code ) . to . eq ( FAKE_STATUS_CODE_1 ) ;
376
+ expect ( err . note ) . to . be . ok ;
377
377
expect ( spy . callCount ) . to . eq ( 1 ) ;
378
378
done ( ) ;
379
379
} ) ;
@@ -382,9 +382,9 @@ describe('retryable', function() {
382
382
it ( 'aborts retries' , function ( done ) {
383
383
var apiCall = createApiCall ( fail , settings ) ;
384
384
apiCall ( null , null , function ( err , resp ) {
385
- expect ( err ) . to . be . ok ;
386
385
expect ( err ) . to . be . an ( 'error' ) ;
387
- expect ( err . cause . code ) . to . eq ( FAKE_STATUS_CODE_1 ) ;
386
+ expect ( err . code ) . to . eq ( FAKE_STATUS_CODE_1 ) ;
387
+ expect ( err . note ) . to . be . ok ;
388
388
done ( ) ;
389
389
} ) ;
390
390
} ) ;
@@ -394,9 +394,9 @@ describe('retryable', function() {
394
394
var spy = sinon . spy ( fail ) ;
395
395
var apiCall = createApiCall ( spy , settings ) ;
396
396
apiCall ( null , null , function ( err , resp ) {
397
- expect ( err ) . to . be . ok ;
398
- expect ( err . cause ) . to . be . an ( 'error' ) ;
399
- expect ( err . cause . code ) . to . eq ( FAKE_STATUS_CODE_1 ) ;
397
+ expect ( err ) . to . be . an ( 'error' ) ;
398
+ expect ( err . code ) . to . eq ( FAKE_STATUS_CODE_1 ) ;
399
+ expect ( err . note ) . to . be . ok ;
400
400
expect ( spy . callCount ) . to . eq ( toAttempt ) ;
401
401
done ( ) ;
402
402
} ) ;
@@ -411,9 +411,9 @@ describe('retryable', function() {
411
411
var spy = sinon . spy ( func ) ;
412
412
var apiCall = createApiCall ( spy , settings ) ;
413
413
apiCall ( null , null , function ( err , resp ) {
414
- expect ( err ) . to . be . ok ;
415
- expect ( err . cause ) . to . be . an ( 'error' ) ;
416
- expect ( err . cause . code ) . to . eq ( FAKE_STATUS_CODE_2 ) ;
414
+ expect ( err ) . to . be . an ( 'error' ) ;
415
+ expect ( err . code ) . to . eq ( FAKE_STATUS_CODE_2 ) ;
416
+ expect ( err . note ) . to . be . ok ;
417
417
expect ( spy . callCount ) . to . eq ( 1 ) ;
418
418
done ( ) ;
419
419
} ) ;
@@ -441,9 +441,9 @@ describe('retryable', function() {
441
441
spy , new gax . CallSettings ( { timeout : 0 , retry : retryOptions } ) ) ;
442
442
443
443
apiCall ( null , null , function ( err , resp ) {
444
- expect ( err ) . to . be . ok ;
445
- expect ( err . cause ) . to . be . an ( 'error' ) ;
446
- expect ( err . cause . code ) . to . eq ( FAKE_STATUS_CODE_1 ) ;
444
+ expect ( err ) . to . be . an ( 'error' ) ;
445
+ expect ( err . code ) . to . eq ( FAKE_STATUS_CODE_1 ) ;
446
+ expect ( err . note ) . to . be . ok ;
447
447
var now = new Date ( ) ;
448
448
expect ( now . getTime ( ) - startTime . getTime ( ) ) . to . be . at . least (
449
449
backoff . totalTimeoutMillis ) ;
0 commit comments