Skip to content

Commit 7aba0ba

Browse files
committed
lint
1 parent 17466c9 commit 7aba0ba

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

packages/instrumentation-openai/src/instrumentation.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -537,21 +537,23 @@ export class OpenAIInstrumentation extends InstrumentationBase {
537537
): APIPromise<T> {
538538
return new APIPromise<T>(
539539
new Promise((resolve, reject) => {
540-
promise._thenUnwrap((result) => {
541-
const data = version === "v3" ? (result as any).data : result;
542-
543-
this._endSpan({ type, span, result: data as any });
544-
return result;
545-
}).catch((error: Error) => {
546-
span.setStatus({
547-
code: SpanStatusCode.ERROR,
548-
message: error.message,
540+
promise
541+
._thenUnwrap((result) => {
542+
const data = version === "v3" ? (result as any).data : result;
543+
544+
this._endSpan({ type, span, result: data as any });
545+
return result;
546+
})
547+
.catch((error: Error) => {
548+
span.setStatus({
549+
code: SpanStatusCode.ERROR,
550+
message: error.message,
551+
});
552+
span.recordException(error);
553+
span.end();
554+
throw error;
549555
});
550-
span.recordException(error);
551-
span.end();
552-
throw error;
553-
})
554-
})
556+
}),
555557
);
556558
}
557559

0 commit comments

Comments
 (0)