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

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

Merged
merged 1 commit into from
Apr 13, 2024
Merged

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

merged 1 commit into from
Apr 13, 2024

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
1 check passed
@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
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.

None yet

4 participants