Skip to content

Commit 48a8250

Browse files
committed
Move an error check to a more correct location.
1 parent 374a26d commit 48a8250

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/push/push.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,15 @@ func (pushService *pushService) createOrUpdateReleaseAsset(release *github.Repos
324324
}
325325
log.Debugf("Uploading release asset %s...", assetPathStat.Name())
326326
assetFile, err := os.Open(pushService.cacheDirectory.AssetPath(release.GetTagName(), assetPathStat.Name()))
327+
if err != nil {
328+
return errors.Wrap(err, "Error opening release asset.")
329+
}
327330
defer assetFile.Close()
328331
progressReader := &ioprogress.Reader{
329332
Reader: assetFile,
330333
Size: assetPathStat.Size(),
331334
DrawFunc: ioprogress.DrawTerminalf(os.Stderr, ioprogress.DrawTextFormatBytes),
332335
}
333-
if err != nil {
334-
return errors.Wrap(err, "Error opening release asset.")
335-
}
336336
_, _, err = pushService.uploadReleaseAsset(release, assetPathStat, progressReader)
337337
if err != nil {
338338
return errors.Wrap(err, "Error uploading release asset.")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy