* Update files in /app * Update files in /plugin * Update files in /store * Update files in /utils * Update files in /web * Update store.go * Update command_response.go * check-mocks and check-store-layer checks * Fix build errors * Revert "Fix build errors" This reverts commit 4ee38c3d0bf7bd7d8386f46f0985a0d03245a1d4. * Update .golangci.yml * make i18n-extract and make i18n-check * Commit suggestions * check-mocks and check-store-layers * Update en.json * Update product_notices.go * Update main.go * Fix translations * Regenerate mocks Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5f190b5624
Коммит
6356e906e0
16
app/bot.go
16
app/bot.go
@@ -198,7 +198,7 @@ func (a *App) PatchBot(botUserId string, botPatch *model.BotPatch) (*model.Bot,
|
||||
var appErr *model.AppError
|
||||
switch {
|
||||
case errors.As(nErr, &nfErr):
|
||||
return nil, model.MakeBotNotFoundError(nfErr.Id)
|
||||
return nil, model.MakeBotNotFoundError(nfErr.ID)
|
||||
case errors.As(nErr, &appErr): // in case we haven't converted to plain error.
|
||||
return nil, appErr
|
||||
default: // last fallback in case it doesn't map to an existing app error.
|
||||
@@ -215,7 +215,7 @@ func (a *App) GetBot(botUserId string, includeDeleted bool) (*model.Bot, *model.
|
||||
var nfErr *store.ErrNotFound
|
||||
switch {
|
||||
case errors.As(err, &nfErr):
|
||||
return nil, model.MakeBotNotFoundError(nfErr.Id)
|
||||
return nil, model.MakeBotNotFoundError(nfErr.ID)
|
||||
default: // last fallback in case it doesn't map to an existing app error.
|
||||
return nil, model.NewAppError("GetBot", "app.bot.getbot.internal_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
@@ -254,7 +254,7 @@ func (a *App) UpdateBotActive(botUserId string, active bool) (*model.Bot, *model
|
||||
var nfErr *store.ErrNotFound
|
||||
switch {
|
||||
case errors.As(nErr, &nfErr):
|
||||
return nil, model.MakeBotNotFoundError(nfErr.Id)
|
||||
return nil, model.MakeBotNotFoundError(nfErr.ID)
|
||||
default: // last fallback in case it doesn't map to an existing app error.
|
||||
return nil, model.NewAppError("UpdateBotActive", "app.bot.getbot.internal_error", nil, nErr.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
@@ -276,7 +276,7 @@ func (a *App) UpdateBotActive(botUserId string, active bool) (*model.Bot, *model
|
||||
var appErr *model.AppError
|
||||
switch {
|
||||
case errors.As(nErr, &nfErr):
|
||||
return nil, model.MakeBotNotFoundError(nfErr.Id)
|
||||
return nil, model.MakeBotNotFoundError(nfErr.ID)
|
||||
case errors.As(nErr, &appErr): // in case we haven't converted to plain error.
|
||||
return nil, appErr
|
||||
default: // last fallback in case it doesn't map to an existing app error.
|
||||
@@ -314,7 +314,7 @@ func (a *App) UpdateBotOwner(botUserId, newOwnerId string) (*model.Bot, *model.A
|
||||
var nfErr *store.ErrNotFound
|
||||
switch {
|
||||
case errors.As(err, &nfErr):
|
||||
return nil, model.MakeBotNotFoundError(nfErr.Id)
|
||||
return nil, model.MakeBotNotFoundError(nfErr.ID)
|
||||
default: // last fallback in case it doesn't map to an existing app error.
|
||||
return nil, model.NewAppError("UpdateBotOwner", "app.bot.getbot.internal_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
@@ -328,7 +328,7 @@ func (a *App) UpdateBotOwner(botUserId, newOwnerId string) (*model.Bot, *model.A
|
||||
var appErr *model.AppError
|
||||
switch {
|
||||
case errors.As(err, &nfErr):
|
||||
return nil, model.MakeBotNotFoundError(nfErr.Id)
|
||||
return nil, model.MakeBotNotFoundError(nfErr.ID)
|
||||
case errors.As(err, &appErr): // in case we haven't converted to plain error.
|
||||
return nil, appErr
|
||||
default: // last fallback in case it doesn't map to an existing app error.
|
||||
@@ -534,7 +534,7 @@ func (a *App) SetBotIconImage(botUserId string, file io.ReadSeeker) *model.AppEr
|
||||
var appErr *model.AppError
|
||||
switch {
|
||||
case errors.As(err, &nfErr):
|
||||
return model.MakeBotNotFoundError(nfErr.Id)
|
||||
return model.MakeBotNotFoundError(nfErr.ID)
|
||||
case errors.As(err, &appErr): // in case we haven't converted to plain error.
|
||||
return appErr
|
||||
default: // last fallback in case it doesn't map to an existing app error.
|
||||
@@ -568,7 +568,7 @@ func (a *App) DeleteBotIconImage(botUserId string) *model.AppError {
|
||||
var appErr *model.AppError
|
||||
switch {
|
||||
case errors.As(err, &nfErr):
|
||||
return model.MakeBotNotFoundError(nfErr.Id)
|
||||
return model.MakeBotNotFoundError(nfErr.ID)
|
||||
case errors.As(err, &appErr): // in case we haven't converted to plain error.
|
||||
return appErr
|
||||
default: // last fallback in case it doesn't map to an existing app error.
|
||||
|
||||
Ссылка в новой задаче
Block a user