better error reporting in Typelib.from_ruby