FFI::Library.attach_function raises error with a nonsensical message
--------------------------------------------------------------------

                 Key: JRUBY-5703
                 URL: http://jira.codehaus.org/browse/JRUBY-5703
             Project: JRuby
          Issue Type: Bug
          Components: Miscellaneous
    Affects Versions: JRuby 1.6
            Reporter: John Croisant
            Priority: Trivial


FFI::Library.attach_function raises FFI::NotFoundError when the target function 
does not exist in the library. But, the FFI::NotFoundError constructor is being 
called with the wrong arguments, resulting in a nonsensical error message.

Running this script:
{code:ruby}require 'ffi'
module Foo
  extend FFI::Library
  ffi_lib FFI::Library::LIBC
  attach_function 'missingfunction', [], :void
end
{code}

Results in a nonsensical error message: "FFI::NotFoundError: Function 'Foo' not 
found in [missingfunction]". The module name is being used where the function 
name should be, and the function name is being used where the library name(s) 
should be. Pretty silly. :)

The message should be something like this: "FFI::NotFoundError: Function 
'missingfunction' not found in [libc.so.6]"

(I will attach a patch and submit a pull request once I get the issue number 
for this.)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to