Skip to content

Dead code in makeRequestStreamAsync()? #1400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
alxndrsn opened this issue Apr 3, 2025 · 2 comments · May be fixed by #1401
Open

Dead code in makeRequestStreamAsync()? #1400

alxndrsn opened this issue Apr 3, 2025 · 2 comments · May be fixed by #1401

Comments

@alxndrsn
Copy link
Contributor

alxndrsn commented Apr 3, 2025

parseResponseError() throws rather than returns it's result at

throw e
}

This means that at

const err = await xmlParsers.parseResponseError(response)
this.logHTTP(reqOptions, response, err)
throw err
, makeRequestStreamAsync() does not call this.logHTTP() at line 740.

I noticed this, as ?location requests do not seem to emit close events.

@prakashsvmx
Copy link
Member

getBucketRegionAsync implementation is little different.. it automatically infers/fetches the region if possible from the response else falls back to default region.

@alxndrsn
Copy link
Contributor Author

alxndrsn commented Apr 3, 2025

getBucketRegionAsync implementation is little different.. it automatically infers/fetches the region if possible from the response else falls back to default region.

Line 739 of src/internal/client.ts always throws, so line 740 is never executed. I have opened a PR at #1401 to try to demonstrate the problem more clearly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants