mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 05:40:11 +01:00
Merge pull request #125 from csaf-poc/dev-return-value-on-failed-upload
Improve exit code for failed upload
This commit is contained in:
commit
1a93aba71b
1 changed files with 4 additions and 2 deletions
|
|
@ -288,8 +288,10 @@ func (p *processor) process(filename string) error {
|
|||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
var uploadErr error
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
log.Printf("Upload failed: %s\n", resp.Status)
|
||||
uploadErr := fmt.Errorf("upload failed: %s", resp.Status)
|
||||
fmt.Printf("HTTPS %s\n", uploadErr)
|
||||
}
|
||||
|
||||
var result struct {
|
||||
|
|
@ -313,7 +315,7 @@ func (p *processor) process(filename string) error {
|
|||
writeStrings("Warnings:", result.Warnings)
|
||||
writeStrings("Errors:", result.Errors)
|
||||
|
||||
return nil
|
||||
return uploadErr
|
||||
}
|
||||
|
||||
// findIniFile looks for a file in the pre-defined paths in "iniPaths".
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue