-
Notifications
You must be signed in to change notification settings - Fork 229
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
Added Error::Term for returning {:error, <term>}
#252
Added Error::Term for returning {:error, <term>}
#252
Conversation
Where would you return something arbitrary (i.e. not |
That's a great question. Idiomatically, I would only ever return Perhaps this function would be better as something like It would be pretty strange to return: ReturnTerm(Box::new((atoms::ok(), "some ok result wrapped in an error"))) @filmor is your concern something like the Rust code above? |
In line with the existing options, I think you should just add a |
@filmor Agreed; |
@elbow-jason...do you have time to finish this? If not, let me know and I can take it to the finish-line. |
f2f6be3
to
c36d699
Compare
{:error, <term>}
c36d699
to
5eb1645
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with these changes 👍
I think we should wait to merge this after #264 is merged. There will only be a small number of conflicts to fix in this PR vs the other way round.
Hmm, I just noticed that |
@filmor |
Given that |
@elbow-jason No, I'm recommending a change of semantics for |
@elbow-jason now that #264 has been merged, feel free to fix up this PR so we can merge 👍 |
5eb1645
to
f327a19
Compare
Hi! I added a variant to return any encoder as an error. I think could help ergonomics and help return more meaningful errors from our native Rustler interfaces to Elixir.
Feedback is appreciated. :)