-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Error in http_statuses[[as.character(status)]] : subscript out of bounds #567
Comments
Found this existing issue after lots of similar error messages. For what it's worth, I make ~100k read/write calls through (I haven't been able to create a full reprex without doing something objectively dumb, like "write 100k tiny RDS files with From my vantage point, this low-level error from Both (PS: For my use-cases, 100k read/writes a week with only a 0.5% error rate is pretty remarkable. Thanks for |
I think is a fairly simple fix if someone wants to do a PR. Just check before subsetting:
|
Sometimes I am getting an error
Error in http_statuses[[as.character(status)]] : subscript out of bounds
while callings3saveRDS()
inaws.s3
. As far as I could pinpoint, the issue originates fromhttr
, more specifically inhttp_status
.This is the part of the code that is (I think) is problematic:
This assumes that
http_statuses[[as.character(status)]]
will returnNA
when it is faced with a status code not present inhttp_statuses
, and thus will be handed with: "Unknown http status code: ".However, in reality, it seems
http_statuses[[as.character(status)]]
will just throwsubscript out of bounds
error.Reproducible(ish) example:
Status present in
http_statuses
, works as expected:Unknown status, fails before reaching "Unknown http status code: " handler:
So, I think either
httr:::http_statuses[[as.character(status)]]
has to be called safely and error handled as NA, or indexing should happen one level only.The text was updated successfully, but these errors were encountered: