Skip to content

Commit

Permalink
unwrap LanguageModelError when invoking chat participant (#213784)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken authored May 29, 2024
1 parent 2ee265b commit 4594a1b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/vs/workbench/api/common/extHostChatAgents2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,11 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS
}), token);
} catch (e) {
this._logService.error(e, agent.extension);

if (e instanceof extHostTypes.LanguageModelError && e.cause) {
e = e.cause;
}

return { errorDetails: { message: toErrorMessage(e), responseIsIncomplete: true } };

} finally {
Expand Down

0 comments on commit 4594a1b

Please sign in to comment.