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

Avoid swallowing errors in case of AttachmentType Serialization failure #1953

Conversation

TheSilkMiner
Copy link
Member

Given that this TODO has been here since the inception of the system, and that I've seen quite a few errors get swallowed, I figured it was time to tackle this.

The change itself is trivial, but going through DataResult#getOrThrow rather than first obtaining the Optional and then unconditionally unwrapping it gives us access to the error message that signals the issue within the codec, so the developer has a better idea of what's going on.

It would be better if we were to somehow also be able to print the ID or some other kind of identifying info to specifically indicate which attachment is exploding, but that does not seem to be possible with the system as it is currently designed. For this reason, I decided to leave that temporarily as a further TODO for discussion.

Signed-off-by: TheSilkMiner <thesilkminer@outlook.com>
@neoforged-automation neoforged-automation bot added the 1.21.4 Targeted at Minecraft 1.21.4 label Feb 11, 2025
@neoforged-pr-publishing
Copy link

  • Publish PR to GitHub Packages

@CLAassistant
Copy link

CLAassistant commented Feb 11, 2025

CLA assistant check
All committers have signed the CLA.

Signed-off-by: TheSilkMiner <thesilkminer@outlook.com>
@Technici4n Technici4n merged commit 408012b into neoforged:1.21.x Feb 12, 2025
6 checks passed
@Technici4n
Copy link
Member

@neoforged/bots backport 1.21.1

@neoforged-automation
Copy link

Backporting to 1.21.1...

@neoforged-releases
Copy link

🚀 This PR has been released as NeoForge version 21.4.89-beta.

@neoforged-automation
Copy link

@Technici4n backport to 1.21.1 failed.

Click for failure reason

{"message":"Invalid request.\n\nNo subschema in "anyOf" matched.\nFor 'anyOf/0', {"labels" => []} is not an array.\nFor 'anyOf/1', {"labels" => []} is not an array.\n1 item required; only 0 were supplied.","documentation_url":"https://docs.github.com/rest/issues/labels#add-labels-to-an-issue","status":"422"}
https://github.com/neoforged/PRActionRunner/actions/runs/13290537290

@TheSilkMiner TheSilkMiner deleted the enhancement/better-data-attachment-error-handling branch February 12, 2025 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.4 Targeted at Minecraft 1.21.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants