@@ -86,11 +86,17 @@ type stepResultSimplified struct {
8686 RunnerType RunnerType `json:"runner_type,omitempty"`
8787 RunnerKey string `json:"runner_key,omitempty"`
8888 Result result `json:"result"`
89- Error string `json:"error,omitempty"`
89+ Error * stepErrorSimplified `json:"error,omitempty"`
9090 IncludedRunResults []* runResultSimplified `json:"included_run_result,omitempty"`
9191 Elapsed time.Duration `json:"elapsed,omitempty"`
9292}
9393
94+ type stepErrorSimplified struct {
95+ Message string `json:"message"`
96+ Condition string `json:"condition,omitempty"`
97+ ExprTrace string `json:"expr_trace,omitempty"`
98+ }
99+
94100func newRunResult (desc string , labels []string , path string , included bool , store * store.Store ) * RunResult {
95101 return & RunResult {
96102 Desc : desc ,
@@ -315,7 +321,15 @@ func simplifyStepResults(stepResults []*StepResult) []*stepResultSimplified {
315321 Elapsed : sr .Elapsed ,
316322 }
317323 if sr .Err != nil {
318- s .Error = sr .Err .Error ()
324+ se := & stepErrorSimplified {
325+ Message : sr .Err .Error (),
326+ }
327+ var cfe * condFalseError
328+ if errors .As (sr .Err , & cfe ) {
329+ se .Condition = cfe .cond
330+ se .ExprTrace = cfe .tree
331+ }
332+ s .Error = se
319333 }
320334 simplified = append (simplified , s )
321335 }
0 commit comments