Skip to content
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

reraise with FunctionClauseError generates a duplicated message #10934

Closed
eksperimental opened this issue Apr 21, 2021 · 1 comment
Closed

reraise with FunctionClauseError generates a duplicated message #10934

eksperimental opened this issue Apr 21, 2021 · 1 comment

Comments

@eksperimental
Copy link
Contributor

eksperimental commented Apr 21, 2021

Environment

  • Elixir & Erlang/OTP versions (elixir --version): Elixir master and Elixir 1.11.4, OTP 23

Current behavior

iex(2)> try do
...(2)>   raise "oops"
...(2)> rescue
...(2)>   _exception ->
...(2)>     reraise FunctionClauseError, [module: Foo, function: :foo, arity: 2, args: [1, 2]], __STACKTRACE__
...(2)> end
** (FunctionClauseError) no function clause matching in Foo.foo/2

The following arguments were given to Foo.foo/2:

    # 1
    1

    # 2
    2
    
    
    The following arguments were given to Foo.foo/2:
    
        # 1
        1
    
        # 2
        2

Expected behavior

** (FunctionClauseError) no function clause matching in Foo.foo/2

The following arguments were given to Foo.foo/2:

    # 1
    1

    # 2
    2
@eksperimental eksperimental changed the title reraise with FunctionClauseError generated a duplicated message reraise with FunctionClauseError generates a duplicated message Apr 21, 2021
@josevalim
Copy link
Member

This is expected. Not all exceptions are meant to be raised directly. Some of them are raised only by the compiler.

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

No branches or pull requests

2 participants