Skip to content

Fix effect section errors getting overridden#8498

Merged
APickledWalrus merged 4 commits intodev/patchfrom
patch/fix-effect-section-error
Mar 27, 2026
Merged

Fix effect section errors getting overridden#8498
APickledWalrus merged 4 commits intodev/patchfrom
patch/fix-effect-section-error

Conversation

@UnderscoreTud
Copy link
Copy Markdown
Member

@UnderscoreTud UnderscoreTud commented Mar 13, 2026

Problem

When the section element of an EffectSection errors, but the effect element of it succeeds and later errors due to no syntaxes claiming the section. The user logged errors get overridden by a generic "X is a valid statement but cannot function as a section (:) because there is no syntax in the line to manage it." error.

Solution

Only override the section's error if it doesn't include an explicitly logged error by the user.

Testing Completed

effect section error.sk and manual testing.

Supporting Information

Quick rundown of what happens:

erroring effect section:
    ...
  1. tries to parse the effect section as a section -> succeeds
  2. tries to call init -> fails with explicit error
  3. tries to parse the effect on its own -> succeeds
  4. tries to see if any expression claimed the section -> fails
  5. prints can't claim section (overrides explicit error)

Completes: none
Related: none
AI assistance: none

@UnderscoreTud UnderscoreTud requested review from a team as code owners March 13, 2026 18:43
@UnderscoreTud UnderscoreTud added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Mar 13, 2026
@UnderscoreTud UnderscoreTud requested review from APickledWalrus and Burbulinis and removed request for a team March 13, 2026 18:43
Copy link
Copy Markdown
Member

@sovdeeth sovdeeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just want to ensure that errors thrown in the body of the section (eg during loadCode) won't be negatively impacted by this, right?

@sovdeeth sovdeeth moved this to In Review in 2.15 Releases Mar 23, 2026
@github-project-automation github-project-automation bot moved this from In Review to Awaiting Merge in 2.15 Releases Mar 27, 2026
@skriptlang-automation skriptlang-automation bot added the patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. label Mar 27, 2026
@APickledWalrus APickledWalrus merged commit bc21675 into dev/patch Mar 27, 2026
9 checks passed
@APickledWalrus APickledWalrus deleted the patch/fix-effect-section-error branch March 27, 2026 18:32
@github-project-automation github-project-automation bot moved this from Awaiting Merge to Done - Awaiting Release in 2.15 Releases Mar 27, 2026
@skriptlang-automation skriptlang-automation bot added completed The issue has been fully resolved and the change will be in the next Skript update. and removed patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. labels Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update.

Projects

Status: Done - Awaiting Release

Development

Successfully merging this pull request may close these issues.

3 participants