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

Bad YAML causes crash that is hard to trace #73

Open
ksandom opened this issue Feb 29, 2024 · 0 comments
Open

Bad YAML causes crash that is hard to trace #73

ksandom opened this issue Feb 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ksandom
Copy link
Owner

ksandom commented Feb 29, 2024

Problem

If you forget to put in the key, like this

  special-primaryMoving:
    simpleMovingProtection-enable();

instead of this

  special-primaryMoving:
    value: simpleMovingProtection-enable();

You get this

Exception in thread "main" java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in module java.base of loader 'bootstrap')
        at config.Persistence.walkInput(Persistence.java:173)
        at config.Persistence.load(Persistence.java:119)
        at config.Persistence.load(Persistence.java:103)
        at config.Config.load(Config.java:71)
        at config.Config.load(Config.java:55)
        at handWavey.HandWaveyManager.loadAndSaveConfigToDisk(HandWaveyManager.java:96)
        at handWavey.HandWaveyManager.initialSetup(HandWaveyManager.java:80)
        at handWavey.HandWaveyManager.<init>(HandWaveyManager.java:68)
        at handWavey.HandWavey.main(HandWavey.java:16)

Task

Detect this, and output enough information that a user would be able to solve it.

@ksandom ksandom added the bug Something isn't working label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant