Skip to content

HTTP error handling regression from 3.5.2 to 3.6.0 #1277

@kevinoid

Description

@kevinoid

With swagger-client@3.6.0 if a transport-level HTTP error occurs (e.g. host/port unreachable) it causes an internal error in swagger-client which suppresses the original HTTP error. The problem can be demonstrated with the following command:

node -e "require('swagger-client').http({url: 'http://localhost:1/'}).catch(console.error)"

With swagger-client@3.6.0 this will print TypeError: Cannot read property 'statusText' of undefined along with a stack trace. This is far less useful than the error produced by swagger-client@3.5.2, FetchError: request to http://localhost:1/ failed, reason: connect ECONNREFUSED 127.0.0.1:1.

I bisected the regression to commit 1e9f8f0 from #1261.

Thanks,
Kevin

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions