Skip to content

Commit 762dbdd

Browse files
committed
client: expose IsRetryableConnectError
This allows something like the Meta bridge to check E2EE connect errors and send different bridge states accordingly (ie transient disconnect rather than unknown error).
1 parent ccfa04f commit 762dbdd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ func (cli *Client) Connect() error {
448448
return cli.ConnectContext(cli.BackgroundEventCtx)
449449
}
450450

451-
func isRetryableConnectError(err error) bool {
451+
func IsRetryableConnectError(err error) bool {
452452
if exhttp.IsNetworkError(err) {
453453
return true
454454
}
@@ -473,7 +473,7 @@ func (cli *Client) ConnectContext(ctx context.Context) error {
473473
defer cli.socketLock.Unlock()
474474

475475
err := cli.unlockedConnect(ctx)
476-
if isRetryableConnectError(err) && cli.InitialAutoReconnect && cli.EnableAutoReconnect {
476+
if IsRetryableConnectError(err) && cli.InitialAutoReconnect && cli.EnableAutoReconnect {
477477
cli.Log.Errorf("Initial connection failed but reconnecting in background (%v)", err)
478478
go cli.dispatchEvent(&events.Disconnected{})
479479
go cli.autoReconnect(ctx)

0 commit comments

Comments
 (0)