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

πŸš€ Enhance error handling in PromptHandlers to display error messages in red markdown #382

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/chat/PromptHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,14 @@ export class PromptHandlers {
}
} catch (err: any) {
Logger.getInstance();
Logger.error(err!.error ? err!.error.message.toString() : err.toString());
const errorText = err!.error ? err!.error.message.toString() : err.toString();
Logger.error(errorText);
stream.markdown('\n\nI was not able to retrieve the data from SharePoint. Please check the logs in output window for more information.');

const markdownString = new vscode.MarkdownString();
markdownString.supportHtml = true;
markdownString.appendMarkdown(`<span style="color:#f00;">${errorText}</span>`);
stream.markdown(markdownString);
}
}

Expand Down