diff options
Diffstat (limited to 'steam/status.go')
| -rw-r--r-- | steam/status.go | 10 |
1 files changed, 8 insertions, 2 deletions
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, |
