diff --git a/lib/flow.ex b/lib/flow.ex index 6ab10c9..e5ab69f 100644 --- a/lib/flow.ex +++ b/lib/flow.ex @@ -1538,9 +1538,13 @@ defmodule Flow do defp stages(options) do case Keyword.fetch(options, :stages) do - {:ok, _} -> + {:ok, stages} when is_integer(stages) and stages > 0 -> options + {:ok, stages} -> + raise ArgumentError, + ":stages must be a positive integer, got: #{inspect(stages)}" + :error -> stages = System.schedulers_online() [stages: stages] ++ options