Skip to content

fix: upgrade console.warn to console.error for caught errors in useDependencies and useMissions#4212

Merged
clubanderson merged 2 commits intomainfrom
copilot/auto-qa-fix-swallowed-errors
Apr 2, 2026
Merged

fix: upgrade console.warn to console.error for caught errors in useDependencies and useMissions#4212
clubanderson merged 2 commits intomainfrom
copilot/auto-qa-fix-swallowed-errors

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 2, 2026

Auto-QA flagged three catch blocks using console.warn for genuine error conditions — wrong severity, invisible to production error monitoring.

📌 Fixes


📝 Summary of Changes

Three console.warn calls in catch blocks upgraded to console.error:

  • useDependencies.ts: REST API failure fallback and agent resolve-deps failure
  • useMissions.tsx: WebSocket reconnection failure in .catch() handler
// Before
console.warn('[useDependencies] REST API failed, trying agent:', restErr)
console.warn('[useDependencies] Agent resolve-deps failed:', agentErr)
console.warn('[Missions] WebSocket reconnection failed:', err)

// After
console.error('[useDependencies] REST API failed, trying agent:', restErr)
console.error('[useDependencies] Agent resolve-deps failed:', agentErr)
console.error('[Missions] WebSocket reconnection failed:', err)

Note: useDependencies already surfaces the final error to the UI via setError() — these log lines are intermediate diagnostic signals that deserve the correct severity.


Changes Made

  • Fixed console.warnconsole.error in REST API failure catch (useDependencies.ts:151)
  • Fixed console.warnconsole.error in agent failure catch (useDependencies.ts:164)
  • Fixed console.warnconsole.error in WebSocket reconnection failure catch (useMissions.tsx:590)

Checklist

  • I used a coding agent (Claude Code, Copilot, Gemini, or Codex) to generate/review this code
  • I have reviewed the project's contribution guidelines
  • New cards target console-marketplace, not this repo
  • isDemoData is wired correctly (cards show Demo badge when using demo data)
  • I have written unit tests for the changes (if applicable)
  • I have tested the changes locally and ensured they work as expected
  • All commits are signed with DCO (git commit -s)

Screenshots or Logs (if applicable)

N/A — console output change only.


👀 Reviewer Notes

Purely a log-severity fix. No logic changes. Pre-existing react-hooks/exhaustive-deps warnings in useMissions.tsx are unrelated and pre-date this PR.

@kubestellar-prow kubestellar-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: no Indicates the PR's author has not signed the DCO. labels Apr 2, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 2, 2026

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit f6fd10c
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/69cdd16fc5ed0400085faddc
😎 Deploy Preview https://deploy-preview-4212.console-deploy-preview.kubestellar.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI linked an issue Apr 2, 2026 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

👋 Hey @Copilot — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@kubestellar-prow kubestellar-prow bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 2, 2026
@github-actions github-actions bot added copilot dco-signoff: yes Indicates the PR's author has signed the DCO. and removed dco-signoff: no Indicates the PR's author has not signed the DCO. labels Apr 2, 2026
…Dependencies and useMissions

Signed-off-by: GitHub Copilot <copilot@github.com>

Agent-Logs-Url: https://github.com/kubestellar/console/sessions/3e99b379-026f-4b82-b910-b20bd0fa00b6

Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
@kubestellar-prow kubestellar-prow bot added dco-signoff: no Indicates the PR's author has not signed the DCO. and removed dco-signoff: yes Indicates the PR's author has signed the DCO. labels Apr 2, 2026
@kubestellar-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from clubanderson. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow
Copy link
Copy Markdown
Contributor

Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits.

📝 Please follow instructions in the contributing guide to update your commits with the DCO

Full details of the Developer Certificate of Origin can be found at developercertificate.org.

The list of commits missing DCO signoff:

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@github-actions github-actions bot added dco-signoff: yes Indicates the PR's author has signed the DCO. and removed dco-signoff: no Indicates the PR's author has not signed the DCO. labels Apr 2, 2026
Copilot AI changed the title [WIP] Fix swallowed errors and empty catch blocks in Auto-QA fix: upgrade console.warn to console.error for caught errors in useDependencies and useMissions Apr 2, 2026
Copilot AI requested a review from clubanderson April 2, 2026 02:16
@clubanderson clubanderson marked this pull request as ready for review April 2, 2026 02:19
Copilot AI review requested due to automatic review settings April 2, 2026 02:19
@clubanderson clubanderson removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates hook-level error logging severity so caught failures are emitted as console.error (instead of console.warn), improving visibility in production error monitoring while preserving existing fallback behavior.

Changes:

  • Upgraded REST → agent fallback failure logging in useResolveDependencies() from console.warn to console.error.
  • Upgraded WebSocket reconnection failure logging in MissionProvider from console.warn to console.error.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
web/src/hooks/useDependencies.ts Promotes REST/agent dependency-resolution catch-block logs to console.error for better operational visibility.
web/src/hooks/useMissions.tsx Promotes WebSocket reconnection failure catch-block log to console.error to surface reconnection errors more clearly.

@clubanderson clubanderson merged commit b46a39f into main Apr 2, 2026
25 of 30 checks passed
@kubestellar-prow kubestellar-prow bot deleted the copilot/auto-qa-fix-swallowed-errors branch April 2, 2026 12:36
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot dco-signoff: yes Indicates the PR's author has signed the DCO. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Auto-QA] Swallowed errors and empty catch blocks

3 participants