1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 05:40:11 +01:00

Fix #669
Some checks failed
Go / build (push) Has been cancelled
Go / run_modver (push) Has been cancelled

Return error when the create request failed.
This commit is contained in:
koplas 2025-08-01 10:55:10 +02:00
parent ae184eb189
commit 7fc5600521
No known key found for this signature in database

View file

@ -81,8 +81,9 @@ func (p *processor) create() error {
} }
defer resp.Body.Close() defer resp.Body.Close()
var createError error
if resp.StatusCode != http.StatusOK { if resp.StatusCode != http.StatusOK {
log.Printf("Create failed: %s\n", resp.Status) createError = fmt.Errorf("create failed: %s", resp.Status)
} }
var result struct { var result struct {
@ -100,7 +101,7 @@ func (p *processor) create() error {
writeStrings("Errors:", result.Errors) writeStrings("Errors:", result.Errors)
return nil return createError
} }
// uploadRequest creates the request for uploading a csaf document by passing the filename. // uploadRequest creates the request for uploading a csaf document by passing the filename.