Skip to content

Commit e5dcf4a

Browse files
committed
feat: add condition to fetch exception
1 parent 7665e5e commit e5dcf4a

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

modules/dagger/driver_output.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,17 @@ func (dd *daggerDriver) refreshOutput(ctx context.Context, r resource.Resource,
8888
output.State = state
8989
output.Error = ""
9090

91-
exc, err := dd.getFlinkExceptions(ctx, kubeOut.Configs, rc.Namespace, rc.Name)
92-
if err != nil {
93-
output.Exceptions = Exception{
94-
RootException: "Failed to fetch exceptions: " + err.Error(),
91+
output.Exceptions = Exception{}
92+
if conf.State == StateDeployed && conf.JobState != JobStateSuspended {
93+
exc, err := dd.getFlinkExceptions(ctx, kubeOut.Configs, rc.Namespace, rc.Name)
94+
if err != nil {
95+
output.Exceptions = Exception{
96+
RootException: "Failed to fetch exceptions: " + err.Error(),
97+
}
98+
}
99+
if exc.RootException != "" {
100+
output.Exceptions = exc
95101
}
96-
}
97-
if exc.RootException != "" {
98-
output.Exceptions = exc
99102
}
100103

101104
return modules.MustJSON(output), nil

0 commit comments

Comments
 (0)