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

Fix typescript trace bugs #1275

Merged
merged 6 commits into from
Dec 30, 2024
Merged
Changes from 2 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
6 changes: 3 additions & 3 deletions engine/language_client_typescript/async_context_vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class BamlCtxManager {
return;
}
try {
span.finish(response, manager);
span.finish(response === undefined ? {} : response, manager);
}
catch (e) {
console.error('BAML internal error', e);
Expand All @@ -78,7 +78,7 @@ class BamlCtxManager {
[`arg${i}`]: arg, // generic way to label args
}), {});
const [mng, span] = this.startTrace(name, params);
this.ctx.run(mng, () => {
return this.ctx.run(mng, () => {
try {
const response = func(...args);
this.endTrace(span, response);
Expand All @@ -99,7 +99,7 @@ class BamlCtxManager {
[`arg${i}`]: arg, // generic way to label args
}), {});
const [mng, span] = this.startTrace(name, params);
await this.ctx.run(mng, async () => {
return await this.ctx.run(mng, async () => {
try {
const response = await func(...args);
this.endTrace(span, response);
Expand Down
Loading