exercism / erlang-tests-generator

MIT License
1 stars 8 forks source link

collatz-conjecture: Return or throw `badarg` on invalid input #21

Closed NobbZ closed 5 years ago

NobbZ commented 5 years ago

Rather than to return a numeric value on success and an error-tuple with a static error-string it seems to be more idiomatic to keep the success case as integer and return badarg in the case of invalid input.

This has been brought up initially in exercism/erlang#409.

Its probably this function that needs to get changed:

https://github.com/exercism/erlang-tests-generator/blob/master/src/tgen_collatz-conjecture.erl#L12-L24