Skip to content

Detect invalid enum values in Paper configuration files - #224

Merged
pavog merged 1 commit into
masterfrom
paper-invalid-enum-value
Nov 17, 2026
Merged

pavog merged 1 commit into
masterfrom
paper-invalid-enum-value

Conversation

@pavog

@pavog pavog commented Nov 17, 2026

Copy link
Copy Markdown
Member
[16:21:48 ERROR]: [EnumValueSerializer] Invalid enum constant provided, expected one of [KICK, DROP], but got MAYBE

When a setting in a Paper configuration file has a value that is not one of the allowed values, Paper logs this error, ignores the value and uses the default.
This was not detected before.

This PR adds InvalidEnumValueProblem to the PaperAnalyser, because EnumValueSerializer is only used for the Paper configuration files.
The log does not name the file or the setting, only the invalid value and the allowed values, so the message shows both.
The new UseValidEnumValueSolution tells the user to search the Paper configuration files for the invalid value and replace it.

Paper lists at most ten allowed values and adds , ... when there are more; the list is shown as Paper logs it.

Changes

  • add InvalidEnumValueProblem
  • add UseValidEnumValueSolution
  • add translations for the problem and the solution
  • add paper-invalid-enum-value-26-3.log

@pavog
pavog merged commit 1575954 into master Nov 17, 2026
3 checks passed
@pavog
pavog deleted the paper-invalid-enum-value branch November 17, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant