Skip to content

Commit a2b1d79

Browse files
committed
fix: fixes non_retryable_error_types
1 parent edd6b89 commit a2b1d79

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

internal/plugin/client.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,12 +1057,12 @@ func (svc *Manifest) genClientStartWorkflowOptions(fn *g.Group, workflow protore
10571057

10581058
if policy := opts.GetRetryPolicy(); policy != nil {
10591059
fn.If(g.Id("opts").Dot("RetryPolicy").Op("==").Nil()).Block(
1060-
g.Id("opts").Dot("RetryPolicy").Op("=").Op("&").Qual(temporalPkg, "RetryPolicy").ValuesFunc(func(fields *g.Group) {
1060+
g.Id("opts").Dot("RetryPolicy").Op("=").Op("&").Qual(temporalPkg, "RetryPolicy").CustomFunc(multiLineValues, func(fields *g.Group) {
10611061
if d := policy.GetInitialInterval(); d.IsValid() {
1062-
fields.Id("InitialInterval").Op(":").Id(strconv.FormatInt(d.AsDuration().Nanoseconds(), 10)).Comment(d.AsDuration().String())
1062+
fields.Id("InitialInterval").Op(":").Id(strconv.FormatInt(d.AsDuration().Nanoseconds(), 10))
10631063
}
10641064
if d := policy.GetMaxInterval(); d.IsValid() {
1065-
fields.Id("MaximumInterval").Op(":").Id(strconv.FormatInt(d.AsDuration().Nanoseconds(), 10)).Comment(d.AsDuration().String())
1065+
fields.Id("MaximumInterval").Op(":").Id(strconv.FormatInt(d.AsDuration().Nanoseconds(), 10))
10661066
}
10671067
if n := policy.GetBackoffCoefficient(); n != 0 {
10681068
fields.Id("BackoffCoefficient").Op(":").Lit(n)
@@ -1071,7 +1071,11 @@ func (svc *Manifest) genClientStartWorkflowOptions(fn *g.Group, workflow protore
10711071
fields.Id("MaximumAttempts").Op(":").Lit(n)
10721072
}
10731073
if errs := policy.GetNonRetryableErrorTypes(); len(errs) > 0 {
1074-
fields.Id("NonRetryableErrorTypes").Op(":").Lit(errs)
1074+
fields.Id("NonRetryableErrorTypes").Op(":").Index().String().CustomFunc(multiLineValues, func(vals *g.Group) {
1075+
for _, err := range errs {
1076+
vals.Lit(err)
1077+
}
1078+
})
10751079
}
10761080
}),
10771081
)

0 commit comments

Comments
 (0)