return 404 if the enterprise library error returned is 404 (#22628)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
26c3b4668b
Коммит
b7f2c00554
@@ -13,6 +13,8 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/model"
|
"github.com/mattermost/mattermost-server/v6/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/channels/utils"
|
"github.com/mattermost/mattermost-server/v6/server/channels/utils"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
||||||
@@ -250,6 +252,10 @@ func selfHostedInvoices(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
invoices, err := c.App.Cloud().GetSelfHostedInvoices()
|
invoices, err := c.App.Cloud().GetSelfHostedInvoices()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if err.Error() == "404" {
|
||||||
|
c.Err = model.NewAppError(where, "api.cloud.app_error", nil, "", http.StatusNotFound).Wrap(errors.New("invoices for license not found"))
|
||||||
|
return
|
||||||
|
}
|
||||||
c.Err = model.NewAppError(where, "api.cloud.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
c.Err = model.NewAppError(where, "api.cloud.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user