Skip to content

Commit a993454

Browse files
committed
terminal error fix
1 parent dbcf380 commit a993454

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

pkg/reconcile/reconcile.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ func (te *terminalError) Unwrap() error {
117117
}
118118

119119
func (te *terminalError) Error() string {
120+
if te.err == nil {
121+
return "nil terminal error"
122+
}
120123
return "terminal error: " + te.err.Error()
121124
}
122125

pkg/reconcile/reconcile_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,10 @@ var _ = Describe("reconcile", func() {
9696

9797
Expect(apierrors.IsGone(terminalError)).To(BeTrue())
9898
})
99+
100+
It("should handle nil terminal errors properly", func() {
101+
err := reconcile.TerminalError(nil)
102+
Expect(err.Error()).To(Equal("nil terminal error"))
103+
})
99104
})
100105
})

0 commit comments

Comments
 (0)