Skip to content

Commit f9f232c

Browse files
fix: return error from json.Unmarshal in GetTestResult instead of ignoring it (#258)
Signed-off-by: puneeth_aditya_5656 <myakampuneeth@gmail.com>
1 parent 7f81602 commit f9f232c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

pkg/connectors/microcks_client.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,11 @@ func (c *microcksClient) GetTestResult(testResultID string) (*TestResultSummary,
410410
}
411411

412412
result := TestResultSummary{}
413-
json.Unmarshal([]byte(body), &result)
413+
if err := json.Unmarshal(body, &result); err != nil {
414+
return nil, fmt.Errorf("failed to parse test result response: %w", err)
415+
}
414416

415-
return &result, err
417+
return &result, nil
416418
}
417419

418420
func (c *microcksClient) UploadArtifact(specificationFilePath string, mainArtifact bool) (string, error) {

0 commit comments

Comments
 (0)