mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Merge pull request #1041 from microsoft/isidorn/zesty-moose
re-throw other errors so they show up in the UI
This commit is contained in:
@ -134,6 +134,8 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
} catch (err) {
|
||||
if (err instanceof vscode.LanguageModelError) {
|
||||
console.log(err.message, err.code, err.cause)
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -176,6 +178,9 @@ function handleError(err: any, stream: vscode.ChatResponseStream): void {
|
||||
if (err.cause instanceof Error && err.cause.message.includes('off_topic')) {
|
||||
stream.markdown(vscode.l10n.t('I\'m sorry, I can only explain computer science concepts.'));
|
||||
}
|
||||
} else {
|
||||
// re-throw other errors so they show up in the UI
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user