Skip to content

Commit 1a8239c

Browse files
Address roomote feedback for better error handling
1 parent ea2408f commit 1a8239c

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/api/providers/watsonx.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,8 @@ export class WatsonxAIHandler extends BaseProvider implements SingleCompletionHa
167167
if (!response?.result?.choices?.[0]?.message?.content) {
168168
throw new Error("Invalid or empty response from IBM watsonx API")
169169
}
170-
171-
// Extract the message content directly
172170
return response.result.choices[0].message.content
173171
} catch (error) {
174-
if (error instanceof Error) {
175-
throw new Error(`IBM watsonx completion error: ${error.message}`)
176-
}
177172
throw new Error(`IBM watsonx completion error: ${error.message}`)
178173
}
179174
}

0 commit comments

Comments
 (0)