Fix error handling

This commit is contained in:
Denis Makogon
2017-09-13 21:03:21 +03:00
parent 6f5ec3a0e6
commit 5683d01603

View File

@@ -229,10 +229,11 @@ func (ds *sqlStore) RemoveApp(ctx context.Context, appName string) error {
if err != nil {
return err
}
if _, err := res.RowsAffected(); err != nil {
_, err = res.RowsAffected()
if err == sql.ErrNoRows {
return models.ErrAppsNotFound
}
return nil
return err
}
func (ds *sqlStore) GetApp(ctx context.Context, name string) (*models.App, error) {