Skip to content

Commit

Permalink
Improve the error message when calling something that isn't a generator
Browse files Browse the repository at this point in the history
Closes #105.
  • Loading branch information
whatyouhide committed Jun 18, 2018
1 parent f3d3887 commit 1ae3358
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/stream_data.ex
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ defmodule StreamData do
defp call(other, _seed, _size) do
raise ArgumentError,
"expected a generator, which can be a %StreamData{} struct, an atom, " <>
"or a tuple with generators in it, but got: #{inspect(other)}"
"or a tuple with generators in it, but got:\n\n #{inspect(other)}\n\n" <>
"If you want to use a term as a \"constant\" generator, wrap it in a call to " <>
"StreamData.constant/1 instead."
end

## Generators
Expand Down

0 comments on commit 1ae3358

Please sign in to comment.