soap icon indicating copy to clipboard operation
soap copied to clipboard

No error handling for parse_from_url

Open dfalling opened this issue 5 years ago • 0 comments

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

dfalling avatar Jun 11 '20 04:06 dfalling