Skip to content

Fix stack trace when buying from sign when inventory full#5761

Merged
pop4959 merged 1 commit intoEssentialsX:2.xfrom
rymiel:fix-5736-mistake
Apr 13, 2024
Merged

Fix stack trace when buying from sign when inventory full#5761
pop4959 merged 1 commit intoEssentialsX:2.xfrom
rymiel:fix-5736-mistake

Conversation

@rymiel
Copy link
Contributor

@rymiel rymiel commented Apr 13, 2024

PR #5736 made ChargeException implement TranslatableException and in doing so, changed the semantics of its constructor. However there were 2 uses of that constructor that did not pass a locale key as is expected now, and instead passed in a regular string. These 2 uses are when you attempt to use a buy sign or a trade sign, and the operation fails because your inventory is full.

This causes the translator to blow up and put an error trace in the console, as EssentialsX's translator has no fallbacks. There were no other perceivable issues other than the console spam.

This PR also resolves a TODO.

image

PR #5736 made ChargeException implement TranslatableException and in
doing so, changed the meaning of its constructor. However there were 2
uses of that constructor that did not pass a locale key as is expected
now, and instead passed in a regular string. These 2 uses are when you
attempt to use a buy sign or a trade sign, and the operation fails
because your inventory is full.

This causes the translator to blow up and put an error trace in the
console, as EssentialsX's translator has no fallbacks.
There were no other perceivable issues other than the console spam.

This PR also resolves a TODO.
@pop4959 pop4959 added type: bugfix PRs that fix bugs in EssentialsX. module: main Issues or PRs for the main Essentials module misc: adventure Issues and PRs related to the Adventure refactor. Temporary label during 2.21.x cycle. labels Apr 13, 2024
@pop4959 pop4959 enabled auto-merge (squash) April 13, 2024 21:47
@pop4959 pop4959 merged commit c60ed56 into EssentialsX:2.x Apr 13, 2024
@rymiel rymiel deleted the fix-5736-mistake branch April 13, 2024 21:50
@Evidentsinger14
Copy link
Member

Denied, thanks for your contribution.

HarvelsX pushed a commit to HarvelsX/Essentials that referenced this pull request Jun 2, 2024
Starmism pushed a commit to valence-smp/Essentials that referenced this pull request Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

misc: adventure Issues and PRs related to the Adventure refactor. Temporary label during 2.21.x cycle. module: main Issues or PRs for the main Essentials module type: bugfix PRs that fix bugs in EssentialsX.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments