[MM-45991] Check and return JSON errors (#20735)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
fdee1df6fe
Коммит
1738bd6e92
@@ -241,8 +241,8 @@ func (c *Context) SetInvalidRemoteClusterTokenError() {
|
||||
c.Err = NewInvalidRemoteClusterTokenError()
|
||||
}
|
||||
|
||||
func (c *Context) SetJSONEncodingError() {
|
||||
c.Err = NewJSONEncodingError()
|
||||
func (c *Context) SetJSONEncodingError(err error) {
|
||||
c.Err = NewJSONEncodingError(err)
|
||||
}
|
||||
|
||||
func (c *Context) SetCommandNotFoundError() {
|
||||
@@ -294,9 +294,9 @@ func NewInvalidRemoteClusterTokenError() *model.AppError {
|
||||
return err
|
||||
}
|
||||
|
||||
func NewJSONEncodingError() *model.AppError {
|
||||
err := model.NewAppError("Context", "api.context.json_encoding.app_error", nil, "", http.StatusInternalServerError)
|
||||
return err
|
||||
func NewJSONEncodingError(err error) *model.AppError {
|
||||
appErr := model.NewAppError("Context", "api.context.json_encoding.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
return appErr
|
||||
}
|
||||
|
||||
func (c *Context) SetPermissionError(permissions ...*model.Permission) {
|
||||
|
||||
Ссылка в новой задаче
Block a user