[MM-49921] Cloud export compliance (#22189)

* Support for export compliance screening in cloud

* i18n

* Refactor error

* Fix

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Nick Misasi
2023-02-03 10:18:35 -05:00
коммит произвёл GitHub
родитель 6a93d46556
Коммит 366962fe93
2 изменённых файлов: 9 добавлений и 1 удалений

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

@@ -131,7 +131,13 @@ func changeSubscription(c *Context, w http.ResponseWriter, r *http.Request) {
changedSub, err := c.App.Cloud().ChangeSubscription(userId, currentSubscription.ID, subscriptionChange)
if err != nil {
c.Err = model.NewAppError("Api4.changeSubscription", "api.cloud.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
appErr := model.NewAppError("Api4.changeSubscription", "api.cloud.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
if err.Error() == "compliance-failed" {
c.Logger.Error("Compliance check failed", mlog.Err(err))
appErr.StatusCode = http.StatusUnprocessableEntity
}
c.Err = appErr
return
}