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

Supressing nif load errors #19

Open
frekw opened this issue Sep 19, 2016 · 3 comments
Open

Supressing nif load errors #19

frekw opened this issue Sep 19, 2016 · 3 comments

Comments

@frekw
Copy link

frekw commented Sep 19, 2016

Hi!

Just having spent some time trying to understand why snappy-erlang-nif failed to load on my production system, could I suggest either removing the catch here: https://github.com/fdmanana/snappy-erlang-nif/blob/master/src/snappy.erl#L36 or making it optional? :)

Unfortunately, my Erlang chops are a pretty much non-existant, otherwise I'd send a pull request.

Best,
Fredrik

@dch
Copy link
Member

dch commented Sep 21, 2016

The catch is supposed to be there - if your NIF isn't compiled correctly, or not available, and you are including/using the library module in your code, you want this to fail. Or have I missed something?

@frekw
Copy link
Author

frekw commented Sep 21, 2016

Yes, but the catch silences the failure to load the NIF. So during application start it appears as if everything has loaded properly but all calls fail with snappy_nif_not_loaded and you don't get any indication as to why.

@dch
Copy link
Member

dch commented Jan 26, 2017

@frekw the try/catch is in place because this code was originally written when not all versions of erlang could support NIFs, and the parent library then would need to handle it. I think now we can safely remove this check completely.

@dch dch mentioned this issue Nov 7, 2018
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

Successfully merging a pull request may close this issue.

2 participants