@@ -416,7 +416,7 @@ func (connPool *ConnectionPool) EvalTyped(expr string, args interface{}, result
416
416
func (connPool * ConnectionPool ) SelectAsync (space , index interface {}, offset , limit , iterator uint32 , key interface {}, userMode ... Mode ) * tarantool.Future {
417
417
conn , err := connPool .getConnByMode (ANY , userMode )
418
418
if err != nil {
419
- return tarantool . NewErrorFuture (err )
419
+ return newErrorFuture (err )
420
420
}
421
421
422
422
return conn .SelectAsync (space , index , offset , limit , iterator , key )
@@ -427,7 +427,7 @@ func (connPool *ConnectionPool) SelectAsync(space, index interface{}, offset, li
427
427
func (connPool * ConnectionPool ) InsertAsync (space interface {}, tuple interface {}, userMode ... Mode ) * tarantool.Future {
428
428
conn , err := connPool .getConnByMode (RW , userMode )
429
429
if err != nil {
430
- return tarantool . NewErrorFuture (err )
430
+ return newErrorFuture (err )
431
431
}
432
432
433
433
return conn .InsertAsync (space , tuple )
@@ -438,7 +438,7 @@ func (connPool *ConnectionPool) InsertAsync(space interface{}, tuple interface{}
438
438
func (connPool * ConnectionPool ) ReplaceAsync (space interface {}, tuple interface {}, userMode ... Mode ) * tarantool.Future {
439
439
conn , err := connPool .getConnByMode (RW , userMode )
440
440
if err != nil {
441
- return tarantool . NewErrorFuture (err )
441
+ return newErrorFuture (err )
442
442
}
443
443
444
444
return conn .ReplaceAsync (space , tuple )
@@ -449,7 +449,7 @@ func (connPool *ConnectionPool) ReplaceAsync(space interface{}, tuple interface{
449
449
func (connPool * ConnectionPool ) DeleteAsync (space , index interface {}, key interface {}, userMode ... Mode ) * tarantool.Future {
450
450
conn , err := connPool .getConnByMode (RW , userMode )
451
451
if err != nil {
452
- return tarantool . NewErrorFuture (err )
452
+ return newErrorFuture (err )
453
453
}
454
454
455
455
return conn .DeleteAsync (space , index , key )
@@ -460,7 +460,7 @@ func (connPool *ConnectionPool) DeleteAsync(space, index interface{}, key interf
460
460
func (connPool * ConnectionPool ) UpdateAsync (space , index interface {}, key , ops interface {}, userMode ... Mode ) * tarantool.Future {
461
461
conn , err := connPool .getConnByMode (RW , userMode )
462
462
if err != nil {
463
- return tarantool . NewErrorFuture (err )
463
+ return newErrorFuture (err )
464
464
}
465
465
466
466
return conn .UpdateAsync (space , index , key , ops )
@@ -471,7 +471,7 @@ func (connPool *ConnectionPool) UpdateAsync(space, index interface{}, key, ops i
471
471
func (connPool * ConnectionPool ) UpsertAsync (space interface {}, tuple interface {}, ops interface {}, userMode ... Mode ) * tarantool.Future {
472
472
conn , err := connPool .getConnByMode (RW , userMode )
473
473
if err != nil {
474
- return tarantool . NewErrorFuture (err )
474
+ return newErrorFuture (err )
475
475
}
476
476
477
477
return conn .UpsertAsync (space , tuple , ops )
@@ -484,7 +484,7 @@ func (connPool *ConnectionPool) UpsertAsync(space interface{}, tuple interface{}
484
484
func (connPool * ConnectionPool ) CallAsync (functionName string , args interface {}, userMode Mode ) * tarantool.Future {
485
485
conn , err := connPool .getNextConnection (userMode )
486
486
if err != nil {
487
- return tarantool . NewErrorFuture (err )
487
+ return newErrorFuture (err )
488
488
}
489
489
490
490
return conn .CallAsync (functionName , args )
@@ -496,7 +496,7 @@ func (connPool *ConnectionPool) CallAsync(functionName string, args interface{},
496
496
func (connPool * ConnectionPool ) Call16Async (functionName string , args interface {}, userMode Mode ) * tarantool.Future {
497
497
conn , err := connPool .getNextConnection (userMode )
498
498
if err != nil {
499
- return tarantool . NewErrorFuture (err )
499
+ return newErrorFuture (err )
500
500
}
501
501
502
502
return conn .Call16Async (functionName , args )
@@ -508,7 +508,7 @@ func (connPool *ConnectionPool) Call16Async(functionName string, args interface{
508
508
func (connPool * ConnectionPool ) Call17Async (functionName string , args interface {}, userMode Mode ) * tarantool.Future {
509
509
conn , err := connPool .getNextConnection (userMode )
510
510
if err != nil {
511
- return tarantool . NewErrorFuture (err )
511
+ return newErrorFuture (err )
512
512
}
513
513
514
514
return conn .Call17Async (functionName , args )
@@ -518,7 +518,7 @@ func (connPool *ConnectionPool) Call17Async(functionName string, args interface{
518
518
func (connPool * ConnectionPool ) EvalAsync (expr string , args interface {}, userMode Mode ) * tarantool.Future {
519
519
conn , err := connPool .getNextConnection (userMode )
520
520
if err != nil {
521
- return tarantool . NewErrorFuture (err )
521
+ return newErrorFuture (err )
522
522
}
523
523
524
524
return conn .EvalAsync (expr , args )
@@ -548,7 +548,7 @@ func (connPool *ConnectionPool) DoTyped(req tarantool.Request, result interface{
548
548
func (connPool * ConnectionPool ) DoAsync (req tarantool.Request , userMode Mode ) * tarantool.Future {
549
549
conn , err := connPool .getNextConnection (userMode )
550
550
if err != nil {
551
- return tarantool . NewErrorFuture (err )
551
+ return newErrorFuture (err )
552
552
}
553
553
554
554
return conn .DoAsync (req )
@@ -802,3 +802,9 @@ func (connPool *ConnectionPool) getConnByMode(defaultMode Mode, userMode []Mode)
802
802
803
803
return connPool .getNextConnection (mode )
804
804
}
805
+
806
+ func newErrorFuture (err error ) * tarantool.Future {
807
+ fut := tarantool .NewFuture ()
808
+ fut .SetError (err )
809
+ return fut
810
+ }
0 commit comments