Skip to content

Commit

Permalink
Add checks for scoring values
Browse files Browse the repository at this point in the history
  • Loading branch information
papey committed May 10, 2021
1 parent b269562 commit 5284109
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/blindtest/blindtest.ex
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ defmodule BlindTest do
{:error, "value #{} for key #{k} is invalid (not an integer)"}

{parsed, _} ->
{:ok, {atom, parsed}}
if parsed > 0,
do: {:ok, {atom, parsed}},
else: {:error, {"value #{v} is not a positive integer"}}
end
end
else
Expand Down

0 comments on commit 5284109

Please sign in to comment.