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

feat: an option to throw error of result #120

Merged
merged 3 commits into from
Aug 4, 2024

Conversation

anatawa12
Copy link
Contributor

Closes #119

@oscartbeaumont
Copy link
Member

Looks great but I recon we replace throw_error_of_result: boolean with something like error_handling and the following enum:

/// The mode which the error handling is done in the bindings.
pub enum ErrorHandlingMode {
   /// Errors will be thrown
   Throw,
   /// Errors will be returned as a Result enum
   Result,
}

so in the future when we solve #89 we can just add a variant for it.

Also feel free to ignore CI, happy to merge with it failing cause that's all problems on main.

@anatawa12
Copy link
Contributor Author

I have reimplemented with ErrorHandlingMode enum

@oscartbeaumont oscartbeaumont merged commit cc11448 into specta-rs:main Aug 4, 2024
@oscartbeaumont
Copy link
Member

Thanks!

@anatawa12 anatawa12 deleted the throw-error-of-result branch August 4, 2024 08:43
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.

[FEATURE] an option to not wrap with Result, throw error instead.
2 participants