Fix noisy slack queue message error
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -365,8 +365,7 @@ func (s TrustCenterAccessService) Update(
|
||||
|
||||
if shouldUpdateSlackMessage {
|
||||
if err := s.svc.SlackMessages.QueueSlackNotification(ctx, access.Email, access.TrustCenterID); err != nil {
|
||||
var noConnectorErr slack.ErrNoSlackConnector
|
||||
if !errors.Is(err, noConnectorErr) {
|
||||
if !errors.Is(err, slack.ErrNoSlackConnector) {
|
||||
return nil, fmt.Errorf("cannot queue slack notification: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,11 +33,9 @@ const (
|
||||
slackMessageDeduplicationWindow = 7 * 24 * time.Hour
|
||||
)
|
||||
|
||||
type ErrNoSlackConnector struct{}
|
||||
|
||||
func (e ErrNoSlackConnector) Error() string {
|
||||
return "no slack connector found for organization"
|
||||
}
|
||||
var (
|
||||
ErrNoSlackConnector = errors.New("no slack connector found for organization")
|
||||
)
|
||||
|
||||
type (
|
||||
SlackMessageService struct {
|
||||
@@ -214,7 +212,7 @@ func (s *SlackMessageService) QueueSlackNotification(
|
||||
}
|
||||
|
||||
if !hasSlackConnector {
|
||||
return ErrNoSlackConnector{}
|
||||
return ErrNoSlackConnector
|
||||
}
|
||||
|
||||
documents, reports, files, err := s.loadDocumentsReportsAndFilesFromAccesses(ctx, tx, trustCenterAccess.ID)
|
||||
|
||||
Reference in New Issue
Block a user