Skip to content

Commit af44144

Browse files
committed
Update recoverIfPanic() func comments
Signed-off-by: Fatih Türken <turkenf@gmail.com>
1 parent 11cd2f5 commit af44144

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pkg/controller/external_async_tfpluginfw.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,14 @@ type panicHandler struct {
139139
err error
140140
}
141141

142-
// recoverIfPanic recovers from panics, if any. Calls to this function
143-
// should be defferred directly: `defer ph.recoverIfPanic()`. Panic
144-
// recovery won't work if the call is wrapped in another function
145-
// call, such as `defer func() { ph.recoverIfPanic() }()`. On
146-
// recovery, API machinery panic handlers run. The implementation
147-
// follows the outline of panic recovery mechanism in
148-
// controller-runtime:
142+
// recoverIfPanic recovers from panics, if any. Upon recovery, the
143+
// error is set to a recovery message. Otherwise, the error is left
144+
// unmodified. Calls to this function should be defferred directly:
145+
// `defer ph.recoverIfPanic()`. Panic recovery won't work if the call
146+
// is wrapped in another function call, such as `defer func() {
147+
// ph.recoverIfPanic() }()`. On recovery, API machinery panic handlers
148+
// run. The implementation follows the outline of panic recovery
149+
// mechanism in controller-runtime:
149150
// https://github.com/kubernetes-sigs/controller-runtime/blob/v0.17.3/pkg/internal/controller/controller.go#L105-L112
150151
func (ph *panicHandler) recoverIfPanic() {
151152
if r := recover(); r != nil {

0 commit comments

Comments
 (0)