Skip to content

Improved FFI error handling #51

Description

@gsleap

From Chris Jordan: "I've recently stumbled upon this guide for error handling: https://michael-f-bryan.github.io/rust-ffi-guide/errors/return_types.html
This makes things much cleaner by having mwalib track the last error and the caller allocates their own string to display it if they want to. Right now, mwalib FFI callers are allocating an error string length which could be overflowed (this is pedantic, but I think it's nice to have a loose end removed) and providing two extra arguments to every function. It's also possible to handle panics better (which aren't handled at all right now). I've been working on doing all this kinda thing through hyperbeam, let me know if you wanna chat about it."

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions