Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix]: added try catch block to handle errors in createNewConversation function in Copilot.tsx #118

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

OlibhiaGhosh
Copy link
Contributor

Issue:
Enhancing error handling in the createNewConversation function in the Copilot.tsx file.

Description
The createNewConversation function in the Copilot.tsx file currently lacks error handling, which can lead to potential issues during execution. To address this, the proposed change involves refactoring the function to include try-catch blocks for proper error handling.

Issue Number: #113

@mason-at-pieces mason-at-pieces self-requested a review June 4, 2024 18:49
@@ -14,41 +14,45 @@ let GlobalConversationID: string;

// going to use get all conversations with a few extra steps to store the current conversations locally.
export function createNewConversation() {
try{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey @OlibhiaGhosh! This is great thank you!

Small thing, could you ensure that the spacing for the try/catch is correct?

Ex:

try {
  // ...
} catch (error) {
  // ...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have checked the spacing. It seems correct to me.

Is there any issue?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just keeping the syntax the same throughout so that there is a space between try and { and for the catch as well 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have made the changes!

Can you please review it?

Copy link

@Arindam-at-Pieces Arindam-at-Pieces left a comment

Choose a reason for hiding this comment

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

LGTM

Great work @OlibhiaGhosh !

Copy link
Collaborator

@mason-at-pieces mason-at-pieces left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@mason-at-pieces mason-at-pieces merged commit 06f9522 into pieces-app:main Jun 5, 2024
1 check passed
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.

3 participants