Skip to content

Improve error handling#37

Merged
charlesLoder merged 2 commits intomainfrom
issue-26/error-handling
Sep 3, 2025
Merged

Improve error handling#37
charlesLoder merged 2 commits intomainfrom
issue-26/error-handling

Conversation

@charlesLoder
Copy link
Owner

@charlesLoder charlesLoder commented Sep 3, 2025

Closes #26
Slightly improves the error handling by telling users that an error occurred.

Later iterations can make it more robust

@charlesLoder charlesLoder force-pushed the issue-26/error-handling branch from e288126 to ce2f326 Compare September 3, 2025 16:58
@charlesLoder charlesLoder requested a review from Copilot September 3, 2025 17:01
Copy link
Contributor

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

This PR improves error handling by providing user-facing error messages and refactoring the CSS structure for better maintainability. The changes ensure users are informed when errors occur instead of relying solely on console logging.

  • Simplifies error logging in the UserTokenProvider
  • Adds proper state management for conversation clearing
  • Implements user-visible error messages in the UI

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/providers/userTokenProvider/index.tsx Simplifies error logging by removing descriptive text
src/plugin/Panel/ChatInput/index.tsx Adds conversation state reset when clearing conversations
src/components/Messages/style.module.css Refactors CSS structure and adds error state styling for user feedback

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

this.set_conversation_state("idle");
} catch (error) {
console.error("Error sending messages:", error); // eslint-disable-line no-console
console.error(error); // eslint-disable-line no-console
Copy link

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

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

The error message has been simplified but may be less helpful for debugging. The previous message 'Error sending messages:' provided context about where the error occurred, which is valuable for troubleshooting.

Suggested change
console.error(error); // eslint-disable-line no-console
console.error("Error generating response:", error); // eslint-disable-line no-console

Copilot uses AI. Check for mistakes.
@charlesLoder charlesLoder merged commit b719d72 into main Sep 3, 2025
3 checks passed
@charlesLoder charlesLoder deleted the issue-26/error-handling branch September 3, 2025 17:04
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.

Slightly better error handling

1 participant

Comments