Skip to content

Raising a string causes TypeError instead of intended validation error#616

Closed
huyhoang171106 wants to merge 1 commit intooffa:masterfrom
huyhoang171106:fix/raising-a-string-causes-typeerror-instea
Closed

Raising a string causes TypeError instead of intended validation error#616
huyhoang171106 wants to merge 1 commit intooffa:masterfrom
huyhoang171106:fix/raising-a-string-causes-typeerror-instea

Conversation

@huyhoang171106
Copy link
Copy Markdown

Summary

In Python 3, raise "..." is invalid because exceptions must derive from BaseException. When a malformed app entry is encountered (len(matches) != 1), this path crashes with TypeError: exceptions must derive from BaseException, masking the real input problem and breaking the CI check.

Files changed

  • ensure_sorted.py (modified)

Testing

  • Not run in this environment.

Closes #615

…ation error

Signed-off-by: Nguyen Huy Hoang <181364121+huyhoang171106@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 27, 2026 09:35
Copy link
Copy Markdown

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

Fixes a Python 3 incompatibility in ensure_sorted.py so malformed app entries raise a proper exception type (instead of crashing with a TypeError), improving CI failure signaling when README app lines are invalid.

Changes:

  • Replaces an invalid raise "..." with a ValueError.
  • Improves the validation error message to include the match count and the offending line.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@huyhoang171106
Copy link
Copy Markdown
Author

Auto-closed: CI checks failed

The following checks failed: Cleanup artifacts

Closing this PR since required CI checks did not pass. Sorry for the inconvenience.

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.

fix: raising a string causes typeerror instead of intended validation error

2 participants