Skip to content

Fix: Hide sensitive backend configuration errors from user interface#96

Open
Krishanhkr wants to merge 5 commits intoINCF:mainfrom
Krishanhkr:fix-error-message
Open

Fix: Hide sensitive backend configuration errors from user interface#96
Krishanhkr wants to merge 5 commits intoINCF:mainfrom
Krishanhkr:fix-error-message

Conversation

@Krishanhkr
Copy link

This PR addresses the issue of sensitive backend configuration errors being exposed directly to the end-user in the chat UI.

Changes:

  • Modified the exception handling in backend/agents.py -> handle_chat method.
  • Replaced the direct exception string return with a user-friendly generic error message.

Closes #95

Copy link
Collaborator

@QuantumByte-01 QuantumByte-01 left a comment

Choose a reason for hiding this comment

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

Correct fix — the generic message is appropriate and hides internal details from users.

Two notes:

  1. This PR and PR #92 both modify the same exception handler in handle_chat — they will conflict. Merge one first.
  2. The existing print(f"Error in handle_chat: {e}") and traceback.print_exc() remain. Consider replacing with logger.exception() in a follow-up to keep logging consistent.

@Krishanhkr
Copy link
Author

"Thanks for the feedback!
I've updated the PR to use logger.exception() for consistent logging in
backend/agents.py

I have also synced my branch with the latest main.

Regarding the conflict with PR #92, I am happy to rebase once #92 is merged, or you can merge this one first as per your preference. Ready for another review!"

@Krishanhkr
Copy link
Author

Krishanhkr commented Mar 23, 2026

Hii,

I have resolved the merge conflicts and updated the PR accordingly.
All suggested changes have been implemented.

Please let me know if any further improvements are needed.
Looking forward to your feedback.

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.

[Bug/Enhancement] Sensitive backend configuration errors are exposed directly to the end-user in the chat UI

2 participants