-
Notifications
You must be signed in to change notification settings - Fork 45
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
Create session error code #392
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #392 +/- ##
==========================================
- Coverage 88.67% 88.66% -0.02%
==========================================
Files 21 21
Lines 5953 5945 -8
==========================================
- Hits 5279 5271 -8
Misses 674 674
|
@@ -314,16 +314,18 @@ static void s_on_request_finished( | |||
struct aws_credentials *credentials = NULL; | |||
int error_code = meta_request_result->error_code; | |||
|
|||
if (error_code == AWS_ERROR_SUCCESS && meta_request_result->response_status != 200) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old logic seemed better, where we only set the special error code if the response was successfully received.
In the new way, there's no way to distinguish 4xx responses from "the connection died before I got a response".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
I am checking the request sent via the error response body to be empty or not.
error_code = AWS_ERROR_S3EXPRESS_CREATE_SESSION_FAILED; | ||
AWS_LOGF_ERROR( | ||
AWS_LS_AUTH_CREDENTIALS_PROVIDER, | ||
"(id=%p): CreateSession call failed with http status: %d, and error response body is: %.*s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, logging the response body 👍
Issue #, if available:
Description of changes:
AWS_ERROR_S3EXPRESS_CREATE_SESSION_FAILED
for CreateSession failed.aws_s3_response_status
to use theAWS_HTTP_STATUS_CODE*
, there is no reason to keep two different set of enums for the status code. It makes me confused.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.