Migrate to idiomatic error handling app/a*.go and app/b*.go (#9455)

Этот коммит содержится в:
Jesús Espino
2018-09-25 14:42:06 +02:00
коммит произвёл Joram Wilander
родитель 3785ad48c1
Коммит 7636650a25
5 изменённых файлов: 93 добавлений и 86 удалений

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

@@ -36,7 +36,9 @@ func (a *App) SaveBrandImage(imageData *multipart.FileHeader) *model.AppError {
config, _, err := image.DecodeConfig(file)
if err != nil {
return model.NewAppError("SaveBrandImage", "brand.save_brand_image.decode_config.app_error", nil, err.Error(), http.StatusBadRequest)
} else if config.Width*config.Height > model.MaxImageSize {
}
if config.Width*config.Height > model.MaxImageSize {
return model.NewAppError("SaveBrandImage", "brand.save_brand_image.too_large.app_error", nil, err.Error(), http.StatusBadRequest)
}