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

list_buckets/0 crashes if there are no buckets visible #38

Open
lpil opened this issue Oct 26, 2018 · 0 comments
Open

list_buckets/0 crashes if there are no buckets visible #38

lpil opened this issue Oct 26, 2018 · 0 comments

Comments

@lpil
Copy link

lpil commented Oct 26, 2018

When made to an account with no buckets:

iex(1)>     ExAws.S3.list_buckets |> ExAws.request
** (Protocol.UndefinedError) protocol Enumerable not implemented for nil. This protocol is implemented for: DBConnection.PrepareStream, DBConnection.Stream, Date.Range, Ecto.Adapters.SQL.Stream, File.Stream, F
loki.HTMLTree, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, List, Map, MapSet, Postgrex.Stream, Range, Stream, Timex.Interval
    (elixir) lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir) lib/enum.ex:141: Enumerable.reduce/3
    (elixir) lib/stream.ex:933: Stream.do_enum_transform/7
    (elixir) lib/stream.ex:857: Stream.do_transform/5
    (sweet_xml) lib/sweet_xml.ex:582: anonymous fn/4 in SweetXml.continuation_opts/2
    (xmerl) xmerl_scan.erl:568: :xmerl_scan.scan_document/2
    (xmerl) xmerl_scan.erl:291: :xmerl_scan.string/2
    (sweet_xml) lib/sweet_xml.ex:237: SweetXml.parse/2
    (sweet_xml) lib/sweet_xml.ex:421: SweetXml.xpath/2
    (sweet_xml) lib/sweet_xml.ex:451: SweetXml.xpath/3
    (sweet_xml) lib/sweet_xml.ex:526: anonymous fn/4 in SweetXml.xmap/3
    (elixir) lib/map.ex:791: Map.get_and_update/3
    (sweet_xml) lib/sweet_xml.ex:526: SweetXml.xmap/3
    (sweet_xml) lib/sweet_xml.ex:525: SweetXml.xmap/3
    (ex_aws_s3) lib/ex_aws/s3/parsers.ex:51: ExAws.S3.Parsers.parse_all_my_buckets_result/1

This is due to the XML parser returning nil instead of [], it is ambiguous in the XML.

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