Migrate to idiomatic error handling app/a*.go and app/b*.go (#9455)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
3785ad48c1
Коммит
7636650a25
12
app/audit.go
12
app/audit.go
@@ -8,17 +8,17 @@ import (
|
||||
)
|
||||
|
||||
func (a *App) GetAudits(userId string, limit int) (model.Audits, *model.AppError) {
|
||||
if result := <-a.Srv.Store.Audit().Get(userId, 0, limit); result.Err != nil {
|
||||
result := <-a.Srv.Store.Audit().Get(userId, 0, limit)
|
||||
if result.Err != nil {
|
||||
return nil, result.Err
|
||||
} else {
|
||||
return result.Data.(model.Audits), nil
|
||||
}
|
||||
return result.Data.(model.Audits), nil
|
||||
}
|
||||
|
||||
func (a *App) GetAuditsPage(userId string, page int, perPage int) (model.Audits, *model.AppError) {
|
||||
if result := <-a.Srv.Store.Audit().Get(userId, page*perPage, perPage); result.Err != nil {
|
||||
result := <-a.Srv.Store.Audit().Get(userId, page*perPage, perPage)
|
||||
if result.Err != nil {
|
||||
return nil, result.Err
|
||||
} else {
|
||||
return result.Data.(model.Audits), nil
|
||||
}
|
||||
return result.Data.(model.Audits), nil
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user