New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cryptic error when invalid :limit given in IO.inspect #6142

Closed
eksperimental opened this Issue May 24, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@eksperimental
Member

eksperimental commented May 24, 2017

Look at the misspelling in the :limit value

iex(8)> IO.inspect([a: 1, b: 2], limit: :infitiny)
** (ArithmeticError) bad argument in arithmetic expression
    (elixir) lib/inspect/algebra.ex:596: Inspect.Algebra.decrement/1
    (elixir) lib/inspect/algebra.ex:578: Inspect.Algebra.do_surround_many/5
    (elixir) lib/inspect/algebra.ex:562: Inspect.Algebra.do_surround_many/7
    (elixir) lib/io.ex:293: IO.inspect/3

It's impossible to know what's wrong with that Error message.

I was looking at a solution, but it seems that we should be validating Inspect.Opts, just wanted to look for some guidance before investing energy on this.

@josevalim

This comment has been minimized.

Member

josevalim commented May 24, 2017

Let's attempt to improve this on the Erlang side: erlang/otp#1478

@josevalim josevalim closed this May 24, 2017

@eksperimental

This comment has been minimized.

Member

eksperimental commented May 26, 2017

@josevalim it's great to see that issues discovered in Elixir make their way into Erlang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment