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

ensure_compiled! issue when using Hammox.Protect #140

Open
boonious opened this issue Mar 30, 2023 · 0 comments
Open

ensure_compiled! issue when using Hammox.Protect #140

boonious opened this issue Mar 30, 2023 · 0 comments

Comments

@boonious
Copy link

When using use Hammox.Protect (and protect/2) with older versions of Elixir (< 1.12), the following error is raised because Code.ensure_compiled! isn't available in the check_module_exists util function.

** (UndefinedFunctionError) function Code.ensure_compiled!/1 is undefined or private. Did you mean one of:

      * ensure_compiled/1
      * ensure_loaded/1

    (elixir 1.11.4) Code.ensure_compiled!(Hui.ResponseParsers.Parser)
    lib/hammox/protect.ex:153: Hammox.Protect.get_funs!/1

A fix should be created in similar vein to Mox:
https://github.com/dashbitco/mox/blob/a59a1840676ceb0ef6c3e0f4959242ccb5d593ab/lib/mox.ex#L794-L809

Happy to submit a PR since Hammox is still elixir: "~> 1.7".

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

No branches or pull requests

1 participant