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

No error handling for parse_from_url #83

Open
dfalling opened this issue Jun 11, 2020 · 0 comments
Open

No error handling for parse_from_url #83

dfalling opened this issue Jun 11, 2020 · 0 comments

Comments

@dfalling
Copy link

Currently parse_from_url is using .get!, causing an exception if the API call fails. It would be easier to handle these scenarios if an error type was returned instead, eg {:error, error}. I'm happy to take a stab at this in a PR.

  def parse_from_url(path, opts \\ []) do
    request_opts = Keyword.merge([follow_redirect: true, max_redirect: 5], opts)
    %HTTPoison.Response{body: wsdl} = HTTPoison.get!(path, [], request_opts)
    parse(wsdl, path, opts)
  end
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

1 participant