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

Account for Unsuccessful Transactions with DataHolderBuilder.add(Key, value) #2392

Open
WillBAnders opened this issue Sep 5, 2021 · 0 comments
Labels
status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage

Comments

@WillBAnders
Copy link
Contributor

Following #2388, when using builders such as ItemStack.Builder the transaction result of add(Key, value) is silently ignored. This includes adding to readonly values as in that issue, but could also apply to custom data which fails to be applied.

I don't really have any good proposed solutions; the ones I can think of are throwing an exception, adding a new method/argument which throws an exception, or adding a buildResult() method that returns a Tuple<ItemStack, DataTransactionResult> or similar (but I'm not sure how this accounts for multiple failures). I personally prefer throwing an exception for my use cases (as I'm often hardcoding this and expect it to work), but in general I would think buildResult() is likely better.

@limbo-app limbo-app added the status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage label Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage
Projects
None yet
Development

No branches or pull requests

2 participants