mattermost/server/platform/services/remotecluster/error.go
Miguel de la Cruz 98d341fbae
Return an error if an invite for a confirmed remote cluster is received (#28943)
Co-authored-by: Caleb Roseland <caleb@calebroseland.com>
2024-10-25 11:30:29 +02:00

31 lines
601 B
Go

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package remotecluster
import (
"errors"
"fmt"
)
var (
RemoteClusterAlreadyConfirmedError = errors.New("the remote cluster has already been confirmed")
)
type BufferFullError struct {
capacity int
}
func NewBufferFullError(capacity int) BufferFullError {
return BufferFullError{
capacity: capacity,
}
}
func (e BufferFullError) Capacity() int {
return e.capacity
}
func (e BufferFullError) Error() string {
return fmt.Sprintf("buffer capacity (%d) exceeded", e.capacity)
}