Skip to content

Commit

Permalink
terminal error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sheidkamp committed Aug 4, 2023
1 parent dbcf380 commit a993454
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/reconcile/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ func (te *terminalError) Unwrap() error {
}

func (te *terminalError) Error() string {
if te.err == nil {
return "nil terminal error"
}
return "terminal error: " + te.err.Error()
}

Expand Down
5 changes: 5 additions & 0 deletions pkg/reconcile/reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,10 @@ var _ = Describe("reconcile", func() {

Expect(apierrors.IsGone(terminalError)).To(BeTrue())
})

It("should handle nil terminal errors properly", func() {
err := reconcile.TerminalError(nil)
Expect(err.Error()).To(Equal("nil terminal error"))
})
})
})

0 comments on commit a993454

Please sign in to comment.