microsoft / typed-rest-client

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

decompressGzippedContent : missing return when rejecting promise #278

Closed cgadam closed 3 years ago

cgadam commented 3 years ago

Shouldn't this reject have a return next to it? Otherwise both resolve and reject gets called leading to unexpected results.

https://github.com/microsoft/typed-rest-client/blob/master/lib/Util.ts#L93

Actually I think this is the reason why this other error gets exposed: https://github.com/microsoft/typed-rest-client/issues/272 instead of bubbling up the actual error from the zlib library as part of the promise rejection.

anatolybolshakov commented 3 years ago

Hi @cgadam in general this won't lead to issue - since promise object in rejected state can't be moved to resolved.

anatolybolshakov commented 3 years ago

@cgadam I'm closing this at the moment since it looks resolved - please let us know if you have any concerns.