Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

Remove tryCatch #88

Closed
hadley opened this issue Jun 6, 2017 · 2 comments
Closed

Remove tryCatch #88

hadley opened this issue Jun 6, 2017 · 2 comments

Comments

@hadley
Copy link
Collaborator

hadley commented Jun 6, 2017

e.g.

  	r <- tryCatch(POST(
            url = url,
            config = token,
            write_disk(file_name, overwrite = TRUE),
            add_headers(`Accept-Encoding` = "deflate, gzip"),
            progress(), timeout(timeout)),
            error = function(e) return(NULL))

I'm not sure what you're trying to achieve here, but I think you should be silently swallowing errors and interrupts (i.e. pressing escape).

It's likely that you should also be calling stop_for_status(r) to ensure that HTTP errors are surfaced to the user.

@mkearney
Copy link
Collaborator

mkearney commented Jun 7, 2017

This looks like one of my [many] harebrained "solutions" to package dependency issues I didn't understand. The other one I remember involved httr::content, which I should also go back and re-incorporate.

@hadley
Copy link
Collaborator Author

hadley commented Feb 25, 2021

Now part part of #483

@hadley hadley closed this as completed Feb 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants