[MM-60689] Add Webhook ID in the logs (#28846)

* add webhook id to logs

* Move hook_id context to api level from app level.

* pass errCtx to other references of same app-error-id

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Vishal
2024-11-21 13:53:10 +05:30
коммит произвёл GitHub
родитель c98f2e75fb
Коммит 746eb70e01
10 изменённых файлов: 88 добавлений и 69 удалений

Просмотреть файл

@@ -357,7 +357,7 @@ func (s *MmctlE2ETestSuite) TestDeleteChannelsCmd() {
_, err = s.th.App.GetChannel(s.th.Context, channel.Id)
s.Require().NotNil(err)
s.Require().Equal(fmt.Sprintf("GetChannel: Unable to find the existing channel., resource \"Channel\" not found, id: %s", channel.Id), err.Error())
s.CheckErrorID(err, "app.channel.get.existing.app_error")
})
s.Run("Delete channel without permissions", func() {
@@ -401,7 +401,7 @@ func (s *MmctlE2ETestSuite) TestDeleteChannelsCmd() {
s.Require().Nil(channel)
s.Require().NotNil(err)
s.Require().Equal(fmt.Sprintf("GetChannel: Unable to find the existing channel., resource \"Channel\" not found, id: %s", notExistingChannelID), err.Error())
s.CheckErrorID(err, "app.channel.get.existing.app_error")
})
}

Просмотреть файл

@@ -96,3 +96,7 @@ func (s *MmctlE2ETestSuite) RunForAllClients(testName string, fn func(client.Cli
fn(s.th.LocalClient)
})
}
func (s *MmctlE2ETestSuite) CheckErrorID(err error, errorId string) {
api4.CheckErrorID(s.T(), err, errorId)
}