Skip to content

Swallowing exceptions #42

@teamon

Description

@teamon

Consider the following example:

SomeMod
|> stub(:some_fun, fn _, _ -> Decimal.new(nil) end)

Here, Decimal.new(nil) should raise
** (FunctionClauseError) no function clause matching in Decimal.new/1
but what we get instead is:
** (FunctionClauseError) no function clause matching in nil.some_fun/2.

I think that's due tu this piece.
Maybe there's a way to inspect the exception and reraise if it's coming from inside stub.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions