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

FFI error handling #93

Merged
28 commits merged into from
Jan 30, 2024
Merged

FFI error handling #93

28 commits merged into from
Jan 30, 2024

Conversation

ghost
Copy link

@ghost ghost commented Jan 26, 2024

Purpose

Returns result with possible error codes from FFI calls.

Changes

  • Added better error handling from FFI by returning error code indicating the type of error
  • Make exception with error code public such that it can be caught by clients

Checklist

  • My code follows the style of this project.
  • The code compiles without warnings.
  • I have performed a self-review of the changes.
  • I have documented my code, in particular the intent of the
    hard-to-understand areas.
  • (If necessary) I have updated the CHANGELOG.

@ghost ghost requested a review from limemloh January 26, 2024 12:06
@ghost
Copy link
Author

ghost commented Jan 26, 2024

Hi @limemloh

I have made this PR with better error mapping of FFI errors. I’m not sure the interface given to developers are 100 %, so can you give it a review and then we can have a discussion if we can make some improvements.

@ghost ghost mentioned this pull request Jan 29, 2024
rust-bindings/src/lib.rs Show resolved Hide resolved
src/Exceptions/InteropBindingException.cs Outdated Show resolved Hide resolved
src/Interop/Result.cs Outdated Show resolved Hide resolved
@ghost ghost requested a review from limemloh January 30, 2024 08:54
@ghost ghost merged commit c5deb35 into main Jan 30, 2024
2 checks passed
@ghost ghost deleted the better-ffi-error-handling branch January 30, 2024 09:09
This pull request was closed.
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 this pull request may close these issues.

1 participant