Skip to content

enhance: improve error messages with contextual details (closes #577)#890

Open
TorranceTech wants to merge 1 commit into
pyupio:mainfrom
TorranceTech:enhance/error-messages-577
Open

enhance: improve error messages with contextual details (closes #577)#890
TorranceTech wants to merge 1 commit into
pyupio:mainfrom
TorranceTech:enhance/error-messages-577

Conversation

@TorranceTech

Copy link
Copy Markdown

Summary

Addresses #577 by improving five vague exception log messages that previously gave no context about what failed or where.

Changes

File Before After
auth/server.py LOG.exception(e) LOG.exception("Authentication failed unexpectedly: %s", e)
encoding.py "Error detecting encoding" "Error detecting encoding for file %s, falling back to utf-8"
codebase_utils.py "Error saving project info" "Error saving project info to %s"
scan/ecosystems/target.py "Error opening file" "Error opening file %s for scanning"
init/main.py "Unable to load data on the init command" "Unable to load organization data during init. Check your authentication and network connectivity."

Why this matters

  • File paths in log messages make it immediately obvious which file caused the error without needing to add debug prints or re-run with verbose flags.
  • The auth/server.py fix replaces a bare LOG.exception(e) (which duplicates the exception object as the message) with a proper descriptive string.
  • The init/main.py message now includes an actionable hint for the most common root causes (auth/network).

Adds file paths, error context, and actionable hints to five vague
exception log messages across auth, scan, encoding, and init modules.
Closes pyupio#577

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1ba3e492-52df-477e-840e-d8892ed71917

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant