-
Notifications
You must be signed in to change notification settings - Fork 660
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
fix(sdk): report file upload failures as errors #7196
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7196 +/- ##
==========================================
- Coverage 76.28% 76.23% -0.05%
==========================================
Files 509 509
Lines 54174 54180 +6
==========================================
- Hits 41325 41305 -20
- Misses 12499 12527 +28
+ Partials 350 348 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
2784321
to
0048898
Compare
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.
Generally LGTM! Just some comments about test duration; unit tests should avoid sleeping.
Co-authored-by: Timofey Peshin <timoffex@gmail.com>
Co-authored-by: Timofey Peshin <timoffex@gmail.com>
5d10f80
to
892dcfe
Compare
63f320f
to
839ad03
Compare
if err != nil { | ||
return err | ||
} else if resp == nil || resp.StatusCode < 200 || resp.StatusCode > 299 { | ||
return fmt.Errorf("file transfer: upload: failed to upload: %v", resp.Status) |
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.
wait if resp is nil you will have a panic here
Description
If the
retryablehttp.Client
completes a request but the status code isn't 200, report the status as an error rather than returningnil
.Testing
Added 4 tests for: