Skip to content

Commit 4a6e60e

Browse files
Ambient Code Botclaude
authored andcommitted
fix(widgets): display RuntimeError in widget output instead of swallowing
on_apply_button_clicked and on_down_button_clicked caught RuntimeError with a bare `pass`, giving users no feedback when cluster operations failed (e.g. K8s API unavailable, RBAC denial). Print the error message to the widget output area so users can see what went wrong. Fixes RHOAIENG-54733 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f1e880a commit 4a6e60e

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/codeflare_sdk/common/widgets/widgets.py

100644100755
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,16 +307,18 @@ def on_apply_button_clicked(b): # Handle the apply button click event
307307
# If the wait_ready Checkbox is clicked(value == True) trigger the wait_ready function
308308
if wait_ready_check.value:
309309
cluster.wait_ready()
310-
except RuntimeError:
311-
pass
310+
except RuntimeError as e:
311+
# Fix for RHOAIENG-54733: display error instead of silently swallowing it
312+
print(f"Error applying cluster: {e}")
312313

313314
def on_down_button_clicked(b): # Handle the down button click event
314315
with output:
315316
output.clear_output()
316317
try:
317318
cluster.down()
318-
except RuntimeError:
319-
pass
319+
except RuntimeError as e:
320+
# Fix for RHOAIENG-54733: display error instead of silently swallowing it
321+
print(f"Error deleting cluster: {e}")
320322

321323
apply_button.on_click(on_apply_button_clicked)
322324
delete_button.on_click(on_down_button_clicked)

0 commit comments

Comments
 (0)