File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -320,23 +320,26 @@ async def content_generator():
320
320
yield "Error: No response content from OpenRouter API"
321
321
322
322
return content_generator ()
323
- except aiohttp .ClientError as e_client :
323
+ except aiohttp .ClientError as e :
324
+ e_client = e
324
325
log .error (f"Connection error with OpenRouter API: { str (e_client )} " )
325
326
326
327
# Return a generator that yields the error message
327
328
async def connection_error_generator ():
328
329
yield f"Connection error with OpenRouter API: { str (e_client )} . Please check your internet connection and that the OpenRouter API is accessible."
329
330
return connection_error_generator ()
330
331
331
- except RequestException as e_req :
332
+ except RequestException as e :
333
+ e_req = e
332
334
log .error (f"Error calling OpenRouter API asynchronously: { str (e_req )} " )
333
335
334
336
# Return a generator that yields the error message
335
337
async def request_error_generator ():
336
338
yield f"Error calling OpenRouter API: { str (e_req )} "
337
339
return request_error_generator ()
338
340
339
- except Exception as e_unexp :
341
+ except Exception as e :
342
+ e_unexp = e
340
343
log .error (f"Unexpected error calling OpenRouter API asynchronously: { str (e_unexp )} " )
341
344
342
345
# Return a generator that yields the error message
You can’t perform that action at this time.
0 commit comments