Skip to content
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

UnixUtils.curl fails without warning #8

Open
seamusabshere opened this issue Oct 8, 2013 · 3 comments
Open

UnixUtils.curl fails without warning #8

seamusabshere opened this issue Oct 8, 2013 · 3 comments
Assignees

Comments

@seamusabshere
Copy link
Owner

as @activefx found in seamusabshere/remote_table#11, UnixUtils.curl doesn't raise a sensible exception when it can't download a file (basically when it doesn't get a 200 or 300 HTTP response, I think)

UnixUtils.curl should probably do this - maybe we can check $?.exitstatus to see if curl gives us an exit 1 in these cases?

@ghost ghost assigned activefx Oct 8, 2013
@seamusabshere
Copy link
Owner Author

hey @activefx any time to work on this?

@activefx
Copy link
Collaborator

yep, ill take care of it today

@activefx
Copy link
Collaborator

activefx commented Dec 6, 2013

Proposed solution: activefx@b842522

Please let me know your thoughts, it would involve wrapping every top-level API call in a tag_errors block. This would enable:

begin
  UnixUtils.curl 'http://glefdsfsdfsdfds.com'
rescue UnixUtils::Error => e
  puts e.message
end

=> [unix_utils] curl: (6) Could not resolve host: glefdsfsdfsdfds.com; nodename nor servname provided, or not known

Every error from the library would then be able to be rescued from the UnixUtils::Error class

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

No branches or pull requests

2 participants