mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 18:04:03 +03:00
Remove juju/errors
This commit is contained in:
+3
-4
@@ -2,12 +2,11 @@ package telegram
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/juju/errors"
|
||||
|
||||
"github.com/9seconds/mtg/conntypes"
|
||||
"github.com/9seconds/mtg/utils"
|
||||
"github.com/9seconds/mtg/wrappers"
|
||||
@@ -29,11 +28,11 @@ func (b *baseTelegram) dialToAddress(ctx context.Context,
|
||||
addr string) (wrappers.StreamReadWriteCloser, error) {
|
||||
conn, err := b.dialer.Dial("tcp", addr)
|
||||
if err != nil {
|
||||
return nil, errors.Annotate(err, "Dial has failed")
|
||||
return nil, fmt.Errorf("dial has failed: %w", err)
|
||||
}
|
||||
|
||||
if err := utils.InitTCP(conn); err != nil {
|
||||
return nil, errors.Annotate(err, "Cannot initialize TCP socket")
|
||||
return nil, fmt.Errorf("cannot initialize tcp socket: %w", err)
|
||||
}
|
||||
|
||||
return wrappers.NewTelegramConn(ctx, cancel, conn), nil
|
||||
|
||||
Reference in New Issue
Block a user