TypeError: fetch failed sending request

We encountered an issue when sending a request from our API server built on AWS Lambda to the Gemini API server: a TypeError: fetch failed sending request occurred.

Unfortunately, there were no detailed logs left on the Lambda side.

The Lambda function is using the Node.js runtime, specifically Node.js 20. The google-genai package version is 1.13.0. The Lambda is running in the ap-northeast-1 region, and our application is used in Japan.

The error occurred only once and has not reappeared since. After reading the following discussion, we also believe the cause is likely a temporary network issue rather than a problem in our implementation:
https://discuss.ai.google.dev/t/typeerror-fetch-failed-nodejs-gemini/7011

Given this, we suspect a momentary network disruption either on the Gemini API side or between Lambda and the Gemini API. However, we would like to know if there are any other possible causes we should consider.

Additionally, we would like to implement exception handling in case TypeError: fetch failed sending request occurs again in the future. Could you advise on how such error handling should be implemented?

We apologize for not being able to provide more detailed error logs.