Skip to content

Commit 4f7d92c

Browse files
committed
embed ExecutionResult.Err in taskResult
1 parent c07deee commit 4f7d92c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

script/scriptResult.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type taskResult struct {
1616
Name string `yaml:"Name"`
1717
Result bool `yaml:"Result"`
1818
Comment string `yaml:"Comment,omitempty"`
19+
Error string `yaml:"Error,omitempty"`
1920

2021
Started onlyTime `yaml:"Started"`
2122
Duration time.Duration `yaml:"Duration"`

script/scriptRunner.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ func (r Runner) Run(ctx context.Context, scripts tasks.Scripts, globalAbortOnErr
8989
}
9090
}
9191

92+
errString := ""
93+
if res.Err != nil {
94+
errString = res.Err.Error()
95+
}
9296
result.Results = append(result.Results, taskResult{
9397
ID: script.ID,
9498
Function: task.GetName(),
@@ -98,6 +102,7 @@ func (r Runner) Run(ctx context.Context, scripts tasks.Scripts, globalAbortOnErr
98102
Started: onlyTime(taskStart),
99103
Duration: res.Duration,
100104
Changes: changeMap,
105+
Error: errString,
101106
})
102107
}
103108

0 commit comments

Comments
 (0)