Skip to content

Improve AI chatbot error handling for backend connection failures#699

Open
Soumyasucharita12 wants to merge 1 commit into
viru0909-dev:mainfrom
Soumyasucharita12:fix-chatbot-error-handling
Open

Improve AI chatbot error handling for backend connection failures#699
Soumyasucharita12 wants to merge 1 commit into
viru0909-dev:mainfrom
Soumyasucharita12:fix-chatbot-error-handling

Conversation

@Soumyasucharita12
Copy link
Copy Markdown

Description

Improved the AI chatbot error handling logic when backend/API connection failures occur.

Changes Made

  • Replaced the misleading generic fallback response
  • Added clearer and more user-friendly error messages
  • Improved frontend handling for backend connectivity issues

Problem Fixed

Previously, when the backend AI service was unavailable, the chatbot displayed a generic legal response that could confuse users.
Now the chatbot properly informs users when the AI service cannot be reached.

Testing

  • Ran frontend locally using Vite
  • Tested chatbot behavior during backend connection failure
  • Verified improved error handling and user feedback

Fixes #439

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

@Soumyasucharita12 is attempting to deploy a commit to the CodeBlooded's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Soumyasucharita12
Copy link
Copy Markdown
Author

@viru0909-dev I have implemented the frontend error handling improvements and created a PR for this issue. Please review it when possible. Thank you!

@Soumyasucharita12
Copy link
Copy Markdown
Author

@viru0909-dev The failing check appears to be related to Vercel deployment authorization rather than the code changes themselves. I verified the frontend changes locally before creating the PR.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nyaysetu Ready Ready Preview, Comment May 29, 2026 3:48pm

@viru0909-dev
Copy link
Copy Markdown
Owner

Thanks for this PR, @Soumyasucharita12! 🙌

The AI chatbot error message fix is a great improvement — showing an honest error instead of a fake response is the right approach.

However, I noticed a problem with the DocumentGeneratePage.jsx changes. You've replaced CSS variables like var(--bg-surface) and var(--text-main) with hardcoded hex colors (white, #374151, etc.). Our app supports dark mode via CSS custom properties, and hardcoding light-mode colors will completely break the dark mode theme on the Document Generate page.

Could you please:

  1. Keep the AIChatbot.jsx change (the error message fix)
  2. Revert all changes in DocumentGeneratePage.jsx (remove the hardcoded colors)
  3. Fix the indentation in the catch block of AIChatbot.jsx (lines 37-46 are left-aligned)

Once those are fixed, I'll be happy to merge this! Thanks for contributing

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.

AI Assistant returns generic fallback response for legal queries

2 participants