aboutsummaryrefslogtreecommitdiff
path: root/steam/status.go
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2022-01-02 22:25:11 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2022-01-02 22:25:11 -0500
commitcbfd82db8a20be32ffa82a1afa860729f3097de6 (patch)
treed671f714b32bfb64a56f88a02ae6f40041e6e033 /steam/status.go
parented9a9bb126984cdb38a510281a2cb26281e035b1 (diff)
downloadsteam-export-cbfd82db8a20be32ffa82a1afa860729f3097de6.tar.gz
steam-export-cbfd82db8a20be32ffa82a1afa860729f3097de6.tar.xz
Fix bug in JSON output for errors. Fix extract bug due to unset library path.dev
Diffstat (limited to 'steam/status.go')
-rw-r--r--steam/status.go10
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,