Skip to content

Commit 7d756cf

Browse files
committed
update status to internal err when raising exception
1 parent b8318c0 commit 7d756cf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/core/src/utils/openai/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,12 @@ function instrumentMethod<T extends unknown[], R>(
201201
finalOptions.recordOutputs ?? false,
202202
) as unknown as R;
203203
} catch (error) {
204-
captureException(error);
204+
span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
205+
captureException(error, {
206+
mechanism: {
207+
handled: false,
208+
},
209+
});
205210
span.end();
206211
throw error;
207212
}

0 commit comments

Comments
 (0)