Skip to content

Commit

Permalink
handle error silently
Browse files Browse the repository at this point in the history
  • Loading branch information
hassiebp committed Nov 18, 2024
1 parent 77781a8 commit 356b4fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion integration-test/langfuse-openai.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ describe("Langfuse-OpenAI-Integation", () => {
expect(messages).toBeDefined();

await client.flushAsync();
}, 10000);
}, 20_000);

it("should work with structured output parsing with response_format", async () => {
const traceId = randomUUID();
Expand Down
3 changes: 2 additions & 1 deletion langfuse-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,8 @@ abstract class LangfuseCoreStateless {
try {
JSON.stringify(finalEventBody);
} catch (e) {
throw Error(`[Langfuse SDK] Event Body for ${type} is not JSON-serializable: ${e}`);
this._events.emit("error", `[Langfuse SDK] Event Body for ${type} is not JSON-serializable: ${e}`);
return;
}

const queue = this.getPersistedProperty<LangfuseQueueItem[]>(LangfusePersistedProperty.Queue) || [];
Expand Down

0 comments on commit 356b4fa

Please sign in to comment.