fix: replace confusing logHandle! with proper undefined type

This commit is contained in:
daniel-lxs 2025-12-22 18:08:45 -05:00 committed by Hannes Rudolph
parent 87546c9fce
commit e24cd0de81

View file

@ -99,7 +99,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
: {}
// Variable to hold the log handle - will be created after request body is built
let logHandle: ReturnType<typeof this.inferenceLogger.start>
let logHandle: ReturnType<typeof this.inferenceLogger.start> | undefined
try {
switch (modelId) {
@ -379,7 +379,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
})
} catch (error) {
// logHandle may not be assigned if error occurs before request body is built
if (logHandle!) {
if (logHandle) {
logHandle.error(error)
}
throw error