MM-22405: Display the translated message instead of error id (#20462)
For a config failure, we now translate the message and show a user friendly string rather than the error id. This makes things easier to debug and read. https://mattermost.atlassian.net/browse/MM-22405 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
48a9234d69
Коммит
8aa8f21bbb
@@ -6,6 +6,7 @@ package config
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
@@ -842,7 +843,9 @@ func TestDatabaseStoreLoad(t *testing.T) {
|
||||
|
||||
err = ds.Load()
|
||||
if assert.Error(t, err) {
|
||||
assert.EqualError(t, err, "invalid config: Config.IsValid: model.config.is_valid.site_url.app_error, parse \"invalid\": invalid URI for request")
|
||||
var appErr *model.AppError
|
||||
require.True(t, errors.As(err, &appErr))
|
||||
assert.Equal(t, appErr.Id, "model.config.is_valid.site_url.app_error")
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user