Skip to content

non_strict + unstick combo error #255

@MarkoMin

Description

@MarkoMin

I accidentally tried calling meck:new/2 with both options and I got the following error:

=CRASH REPORT==== 24-Oct-2025::09:45:32.846808 ===
  crasher:
    initial call: meck_proc:init/1
    pid: <0.1266.0>
    registered_name: []
    exception error: no match of right hand side value {error,nofile}
      in function  meck_proc:init/1 (/home/mmin/x/_build/test/lib/meck/src/meck_proc.erl:216)
      in call from gen_server:init_it/2 (gen_server.erl:2276)
      in call from gen_server:init_it/6 (gen_server.erl:2236)
    ancestors: [<0.1264.0>,<0.1226.0>,<0.1225.0>,user_drv,<0.70.0>,<0.66.0>,
                  kernel_sup,<0.47.0>]

It wasn't very intuitive on what's going on.

Can be return a better error here? Probably somewhere after meck_proc:validate_options/1 call there could be check whether those 2 options were used together.

Potentially this should be documented somewhere also.

Open to make a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions