mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
bridgev2/networkinterface: don't allow returning errors in Connect
Some checks failed
Some checks failed
This commit is contained in:
parent
b32def2b14
commit
e3d5267485
2 changed files with 4 additions and 5 deletions
|
|
@ -187,10 +187,7 @@ func (br *Bridge) StartLogins() error {
|
|||
for _, login := range user.GetUserLogins() {
|
||||
startedAny = true
|
||||
br.Log.Info().Str("id", string(login.ID)).Msg("Starting user login")
|
||||
err = login.Client.Connect(login.Log.WithContext(ctx))
|
||||
if err != nil {
|
||||
br.Log.Err(err).Msg("Failed to connect existing client")
|
||||
}
|
||||
login.Client.Connect(login.Log.WithContext(ctx))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -344,7 +344,9 @@ type NetworkRoomCapabilities struct {
|
|||
type NetworkAPI interface {
|
||||
// Connect is called to actually connect to the remote network.
|
||||
// If there's no persistent connection, this may just check access token validity, or even do nothing at all.
|
||||
Connect(ctx context.Context) error
|
||||
// This method isn't allowed to return errors, because any connection errors should be sent
|
||||
// using the bridge state mechanism (UserLogin.BridgeState.Send)
|
||||
Connect(ctx context.Context)
|
||||
// Disconnect should disconnect from the remote network.
|
||||
// A clean disconnection is preferred, but it should not take too long.
|
||||
Disconnect()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue