[MM-57070] Remove detailed_error from errors when not in dev mode (#26414)
* remove detailed error from appErr.ToJSON * Revert "remove detailed error from appErr.ToJSON" This reverts commit 3c2fa7352d7a3bc7216b8e073179161779169d4b. * use WipeDetailed instead of err.DetailedError = "" * fix tests --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9e6c06186b
Коммит
6ea363e260
@@ -1497,6 +1497,15 @@ func TestPatchPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("invalid requests", func(t *testing.T) {
|
||||
var origEnableDeveloper bool
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
origEnableDeveloper = *cfg.ServiceSettings.EnableDeveloper
|
||||
*cfg.ServiceSettings.EnableDeveloper = true
|
||||
})
|
||||
defer th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
*cfg.ServiceSettings.EnableDeveloper = origEnableDeveloper
|
||||
})
|
||||
|
||||
r, err := client.DoAPIPut(context.Background(), "/posts/"+post.Id+"/patch", "garbage")
|
||||
require.EqualError(t, err, "Invalid or missing post in request body., invalid character 'g' looking for beginning of value")
|
||||
require.Equal(t, http.StatusBadRequest, r.StatusCode, "wrong status code")
|
||||
|
||||
Ссылка в новой задаче
Block a user