Propagate the parse error for URLs (#19972)
During config validation, we would omit the actual error. This makes debugging difficult. ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3cd3c7dc9a
Коммит
6eb83812e1
@@ -3567,13 +3567,13 @@ func (s *ServiceSettings) isValid() *AppError {
|
||||
|
||||
if *s.SiteURL != "" {
|
||||
if _, err := url.ParseRequestURI(*s.SiteURL); err != nil {
|
||||
return NewAppError("Config.IsValid", "model.config.is_valid.site_url.app_error", nil, "", http.StatusBadRequest)
|
||||
return NewAppError("Config.IsValid", "model.config.is_valid.site_url.app_error", nil, err.Error(), http.StatusBadRequest)
|
||||
}
|
||||
}
|
||||
|
||||
if *s.WebsocketURL != "" {
|
||||
if _, err := url.ParseRequestURI(*s.WebsocketURL); err != nil {
|
||||
return NewAppError("Config.IsValid", "model.config.is_valid.websocket_url.app_error", nil, "", http.StatusBadRequest)
|
||||
return NewAppError("Config.IsValid", "model.config.is_valid.websocket_url.app_error", nil, err.Error(), http.StatusBadRequest)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user