@@ -416,7 +416,7 @@ func (connPool *ConnectionPool) EvalTyped(expr string, args interface{}, result
416416func (connPool * ConnectionPool ) SelectAsync (space , index interface {}, offset , limit , iterator uint32 , key interface {}, userMode ... Mode ) * tarantool.Future {
417417 conn , err := connPool .getConnByMode (ANY , userMode )
418418 if err != nil {
419- return tarantool . NewErrorFuture (err )
419+ return newErrorFuture (err )
420420 }
421421
422422 return conn .SelectAsync (space , index , offset , limit , iterator , key )
@@ -427,7 +427,7 @@ func (connPool *ConnectionPool) SelectAsync(space, index interface{}, offset, li
427427func (connPool * ConnectionPool ) InsertAsync (space interface {}, tuple interface {}, userMode ... Mode ) * tarantool.Future {
428428 conn , err := connPool .getConnByMode (RW , userMode )
429429 if err != nil {
430- return tarantool . NewErrorFuture (err )
430+ return newErrorFuture (err )
431431 }
432432
433433 return conn .InsertAsync (space , tuple )
@@ -438,7 +438,7 @@ func (connPool *ConnectionPool) InsertAsync(space interface{}, tuple interface{}
438438func (connPool * ConnectionPool ) ReplaceAsync (space interface {}, tuple interface {}, userMode ... Mode ) * tarantool.Future {
439439 conn , err := connPool .getConnByMode (RW , userMode )
440440 if err != nil {
441- return tarantool . NewErrorFuture (err )
441+ return newErrorFuture (err )
442442 }
443443
444444 return conn .ReplaceAsync (space , tuple )
@@ -449,7 +449,7 @@ func (connPool *ConnectionPool) ReplaceAsync(space interface{}, tuple interface{
449449func (connPool * ConnectionPool ) DeleteAsync (space , index interface {}, key interface {}, userMode ... Mode ) * tarantool.Future {
450450 conn , err := connPool .getConnByMode (RW , userMode )
451451 if err != nil {
452- return tarantool . NewErrorFuture (err )
452+ return newErrorFuture (err )
453453 }
454454
455455 return conn .DeleteAsync (space , index , key )
@@ -460,7 +460,7 @@ func (connPool *ConnectionPool) DeleteAsync(space, index interface{}, key interf
460460func (connPool * ConnectionPool ) UpdateAsync (space , index interface {}, key , ops interface {}, userMode ... Mode ) * tarantool.Future {
461461 conn , err := connPool .getConnByMode (RW , userMode )
462462 if err != nil {
463- return tarantool . NewErrorFuture (err )
463+ return newErrorFuture (err )
464464 }
465465
466466 return conn .UpdateAsync (space , index , key , ops )
@@ -471,7 +471,7 @@ func (connPool *ConnectionPool) UpdateAsync(space, index interface{}, key, ops i
471471func (connPool * ConnectionPool ) UpsertAsync (space interface {}, tuple interface {}, ops interface {}, userMode ... Mode ) * tarantool.Future {
472472 conn , err := connPool .getConnByMode (RW , userMode )
473473 if err != nil {
474- return tarantool . NewErrorFuture (err )
474+ return newErrorFuture (err )
475475 }
476476
477477 return conn .UpsertAsync (space , tuple , ops )
@@ -484,7 +484,7 @@ func (connPool *ConnectionPool) UpsertAsync(space interface{}, tuple interface{}
484484func (connPool * ConnectionPool ) CallAsync (functionName string , args interface {}, userMode Mode ) * tarantool.Future {
485485 conn , err := connPool .getNextConnection (userMode )
486486 if err != nil {
487- return tarantool . NewErrorFuture (err )
487+ return newErrorFuture (err )
488488 }
489489
490490 return conn .CallAsync (functionName , args )
@@ -496,7 +496,7 @@ func (connPool *ConnectionPool) CallAsync(functionName string, args interface{},
496496func (connPool * ConnectionPool ) Call16Async (functionName string , args interface {}, userMode Mode ) * tarantool.Future {
497497 conn , err := connPool .getNextConnection (userMode )
498498 if err != nil {
499- return tarantool . NewErrorFuture (err )
499+ return newErrorFuture (err )
500500 }
501501
502502 return conn .Call16Async (functionName , args )
@@ -508,7 +508,7 @@ func (connPool *ConnectionPool) Call16Async(functionName string, args interface{
508508func (connPool * ConnectionPool ) Call17Async (functionName string , args interface {}, userMode Mode ) * tarantool.Future {
509509 conn , err := connPool .getNextConnection (userMode )
510510 if err != nil {
511- return tarantool . NewErrorFuture (err )
511+ return newErrorFuture (err )
512512 }
513513
514514 return conn .Call17Async (functionName , args )
@@ -518,7 +518,7 @@ func (connPool *ConnectionPool) Call17Async(functionName string, args interface{
518518func (connPool * ConnectionPool ) EvalAsync (expr string , args interface {}, userMode Mode ) * tarantool.Future {
519519 conn , err := connPool .getNextConnection (userMode )
520520 if err != nil {
521- return tarantool . NewErrorFuture (err )
521+ return newErrorFuture (err )
522522 }
523523
524524 return conn .EvalAsync (expr , args )
@@ -548,7 +548,7 @@ func (connPool *ConnectionPool) DoTyped(req tarantool.Request, result interface{
548548func (connPool * ConnectionPool ) DoAsync (req tarantool.Request , userMode Mode ) * tarantool.Future {
549549 conn , err := connPool .getNextConnection (userMode )
550550 if err != nil {
551- return tarantool . NewErrorFuture (err )
551+ return newErrorFuture (err )
552552 }
553553
554554 return conn .DoAsync (req )
@@ -802,3 +802,9 @@ func (connPool *ConnectionPool) getConnByMode(defaultMode Mode, userMode []Mode)
802802
803803 return connPool .getNextConnection (mode )
804804}
805+
806+ func newErrorFuture (err error ) * tarantool.Future {
807+ fut := tarantool .NewFuture ()
808+ fut .SetError (err )
809+ return fut
810+ }
0 commit comments