From 53c0ce71c4983259b0635410a5825569e329d48e Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 29 Apr 2024 16:32:00 +0100 Subject: [PATCH] Refactor to allow for more error handling --- common/js_handle.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/js_handle.go b/common/js_handle.go index d021d7eb4..26697ea70 100644 --- a/common/js_handle.go +++ b/common/js_handle.go @@ -84,9 +84,11 @@ func (h *BaseJSHandle) Dispose() { // context. The reason the context would be closed is due to the // iteration ending and therefore the associated browser and its assets // will be automatically deleted. - if !errors.Is(err, context.Canceled) { - k6ext.Panic(h.ctx, "dispose: %w", err) + if errors.Is(err, context.Canceled) { + h.logger.Debugf("BaseJSHandle:Dispose", "%v", err) } + + k6ext.Panic(h.ctx, "dispose: %w", err) } }