Skip to content

Commit

Permalink
use status error
Browse files Browse the repository at this point in the history
  • Loading branch information
scarlettperry committed Apr 9, 2021
1 parent 7cea1d8 commit 209a77b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/module/bot/slackbot/slackbot.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (m *mod) Event(ctx context.Context, req *slackbotv1.EventRequest) (*slackbo
err := verifySlackRequest(ctx, req, m.signingSecret)
if err != nil {
m.logger.Error("verify slack request error", log.ErrorField(err))
return nil, status.New(codes.Unauthenticated, err.Error()).Err()
return nil, status.Error(codes.Unauthenticated, err.Error())
}

m.logger.Info("received event from Slack API")
Expand Down Expand Up @@ -169,7 +169,7 @@ func (m *mod) handleURLVerificationEvent(challenge string) (*slackbotv1.EventRes
if challenge == "" {
msg := "slack API provided an empty challenge string"
m.logger.Error(msg)
return nil, status.New(codes.InvalidArgument, msg).Err()
return nil, status.Error(codes.InvalidArgument, msg)
}
return &slackbotv1.EventResponse{Challenge: challenge}, nil
}
Expand Down

0 comments on commit 209a77b

Please sign in to comment.