From 13729ca4d0d64f436309575bf8be50640604c710 Mon Sep 17 00:00:00 2001 From: Adam Howard <91115+codeincontext@users.noreply.github.com> Date: Wed, 23 Oct 2024 12:18:32 +0200 Subject: [PATCH] fix: report chat completion errors (#256) --- packages/aila/src/core/chat/AilaStreamHandler.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/aila/src/core/chat/AilaStreamHandler.ts b/packages/aila/src/core/chat/AilaStreamHandler.ts index 6c4a555cf..1f171825c 100644 --- a/packages/aila/src/core/chat/AilaStreamHandler.ts +++ b/packages/aila/src/core/chat/AilaStreamHandler.ts @@ -47,6 +47,9 @@ export class AilaStreamHandler { this._isStreaming = false; try { await this._chat.complete(); + } catch (e) { + this._chat.aila.errorReporter?.reportError(e); + throw new AilaChatError("Chat completion failed", { cause: e }); } finally { this.closeController(); }