Skip to content

Commit

Permalink
made things explicitly fail on a non- 2xx response in publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Nik Ogura committed Aug 7, 2018
1 parent 1c608d6 commit e60e747
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.1.2",
"version": "2.2.0",
"package": "github.com/nikogura/gomason",
"description": "A tool for testing, building, signing, and publishing your project from a clean workspace.",
"repository": "http://localhost:8081/artifactory/generic-local",
Expand Down
5 changes: 5 additions & 0 deletions pkg/gomason/publishing.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,10 @@ func Upload(client *http.Client, parsedDestination string, data io.Reader, md5su
log.Printf("Response: %s", resp.Status)
}

if resp.StatusCode > 299 {
err = errors.Wrapf(err, "response code %d is not indicative of a successful publish")
return err
}

return err
}

0 comments on commit e60e747

Please sign in to comment.