Skip to content

fix: improve exception handling comments in utility classes - #3250

Closed
lxcxjxhx wants to merge 2 commits into
alibaba:masterfrom
lxcxjxhx:fix/improve-exception-handling-utils
Closed

lxcxjxhx wants to merge 2 commits into
alibaba:masterfrom
lxcxjxhx:fix/improve-exception-handling-utils

Conversation

@lxcxjxhx

Copy link
Copy Markdown

Motivation

The \NetUtils.simpleRequest()\ and \UserStatUtil\ methods silently swallow exceptions with empty catch blocks, making debugging difficult. While the design decision to not interrupt the main workflow is valid, the catch blocks should at least document the intent.

Changes

  • \NetUtils.java: Add clarifying comment explaining why exception is caught and null is returned
  • \UserStatUtil.java: Add clarifying comments to 2 catch blocks explaining that statistics reporting should not interrupt the main workflow

Testing

  • No functional changes - only added clarifying comments
  • Existing behavior is preserved
  • Local environment limitations - relying on CI/CD automated testing

Checklist

  • Code follows the project's coding standards
  • No new dependencies added
  • Commit messages follow conventional format

lxcxjxhx added 2 commits July 29, 2026 17:40
Add clarifying comments to catch blocks in NetUtils and UserStatUtil to explain why exceptions are silently ignored (statistics reporting should not interrupt main workflow).
@CLAassistant

CLAassistant commented Jul 30, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@lxcxjxhx lxcxjxhx closed this by deleting the head repository Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants