Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/api_accounts/lib/api_accounts/dynamo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ defmodule ApiAccounts.Dynamo do
|> Enum.flat_map(fn
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:
I don't really like that neither this nor any of the other calls to do_paginated_query handle its potential error tuple return value, but it doesn't make a huge difference--the tuple will be surfaced when Enum.flat_map raises on it:

** (Protocol.UndefinedError) protocol Enumerable not implemented for {:error, "foo"} of type Tuple
<stacktrace snipped>

so I guess it's fine.
Would prefer to have do_paginated_query just raise directly if all of the call sites will end up raising anyway.

%Task{} = task -> Task.await(task)
results when is_list(results) -> results
_ -> []
end)
end

Expand All @@ -392,6 +393,9 @@ defmodule ApiAccounts.Dynamo do

{:error, reason} ->
{:error, reason}

_ ->
{:error, "unknown response"}
end
end

Expand Down
Loading