From cbfd82db8a20be32ffa82a1afa860729f3097de6 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sun, 2 Jan 2022 22:25:11 -0500 Subject: Fix bug in JSON output for errors. Fix extract bug due to unset library path. --- steam/status.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'steam/status.go') diff --git a/steam/status.go b/steam/status.go index ffb1ac3..6b0d874 100644 --- a/steam/status.go +++ b/steam/status.go @@ -44,7 +44,7 @@ type JobStatusJson struct { Target *Game `json:"Target" example:"Doom"` // Name of the target game Running bool `json:"Running" example:"false"` // Whether or not the job is running Start *time.Time `json:"Start" example:"1629855616"` // Start time as a unix timestamp - Errors []error `json:"Errors"` // List of all errors encountered through the course of the job + Errors []string `json:"Errors"` // List of all errors encountered through the course of the job // If applicablle Size *int64 `json:"Size" example:"12345"` // Game size in bytes @@ -53,13 +53,19 @@ type JobStatusJson struct { } func (j Job) MarshalJSON() ([]byte, error) { + + errs := []string{} + for _, e := range j.errors { + errs = append(errs, e.Error()) + } + return json.Marshal( &JobStatusJson{ Action: j.action, Target: j.target, Running: j.running, Start: j.start, - Errors: j.errors, + Errors: errs, Size: j.size, Transferred: j.transferred, Eta: j.eta, -- cgit v1.2.3