microsoft / typed-rest-client

Node Rest and Http Clients with typings for use with TypeScript
Other
675 stars 118 forks source link

Add `EHOSTUNREACH` to `NetworkRetryErrors` list #372

Closed adviri closed 4 months ago

adviri commented 5 months ago

Hello,

I have noticed that the NetworkRetryErrors list in lib/HttpClient.ts.js does not include EHOSTUNREACH.

const NetworkRetryErrors: string[] = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED'];

I happened to encounter EHOSTUNREACH errors due to temporary network issues. I believe it would be beneficial to include EHOSTUNREACH in the NetworkRetryErrors list so that requests encountering this error can be retried.

Thank you for your time :)

DenisRumyantsev commented 4 months ago

Done, thanks for the suggestion.