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

Change InteropBindingException to public #86

Closed
wants to merge 1 commit into from
Closed

Conversation

ghost
Copy link

@ghost ghost commented Dec 27, 2023

Purpose

Change InteropBindingException such that it can be caught by users.

@ghost ghost requested a review from limemloh December 27, 2023 13:56
@@ -5,7 +5,7 @@ namespace Concordium.Sdk.Exceptions;
/// <summary>
/// Thrown when a interop call failed with possible error as message.
/// </summary>
internal sealed class InteropBindingException : Exception
public sealed class InteropBindingException : Exception
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a big fan of leaking the internals of the SDK, but if you need this we can merge it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would the users ever want to catch this? What can they do in that case? Is this also used for normal error handling?

I think that a design should rather be talking about user meaningful errors and exceptions, not about the fact that there is some FFI binding somewhere. Users should not need to know that or care about it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used for the errors returned by the FFI to rust, so they are needed by the user.
I have discussed this with Søren and the plan is now to rename and change this exception to contain an error code (enum matching the rust side error) and the error message provided by rust.

@ghost
Copy link
Author

ghost commented Jan 29, 2024

Closing in favour of PR #93

@ghost ghost closed this Jan 29, 2024
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.

2 participants