Skip to content

Please show which setting is wrong when a config update fails #516

Description

@sunchengzhu

What happened

When I tried updating several devnet settings in one command, I noticed that an invalid value produced an error that only listed the allowed values. It did not tell me which setting I needed to fix.

It would be helpful if the message included the setting name and the value I entered, especially when changing several settings at once.

Environment

  • OffCKB 0.4.13, installed from npm and confirmed with offckb --version.
  • macOS, arm64; CKB 0.207.0.

Steps to reproduce

  1. Use a disposable devnet that has been initialized and stopped. If needed, start and stop it first, replacing /path/to/ckb with your local CKB executable:

    offckb node --daemon --binary-path /path/to/ckb
    offckb node stop
  2. Try updating these three settings. The last one deliberately uses maybe for whether logs should use color; this setting expects a value such as true or false:

    offckb --json devnet config \
      --set ckb.logger.filter=error \
      --set miner.client.poll_interval=1001 \
      --set ckb.logger.color=maybe

What I see

The command fails. The error message is:

Boolean value must be one of: true/false/yes/no/1/0.

This tells me which values are allowed, but neither ckb.logger.color nor maybe appears in the message. I have to look through the command myself to find the setting it refers to.

What I would like to see

Please include the setting name and the value that was rejected. For example:

Invalid value 'maybe' for 'ckb.logger.color'. Use true/false/yes/no/1/0.

That would let me go straight to the setting I need to correct.

Severity and impact

I would consider this a low-severity usability issue. The main impact is the extra effort needed to find a mistake, particularly for users unfamiliar with the settings or when changing several at once.

In this reproduction, the original configuration and chain data remained unchanged; none of the settings in the failed command were saved. I did not observe data loss or a partially applied update.

The workaround is to check the supplied settings, correct the invalid value, and run the command again. A clearer message would make that step easier, but this does not appear to need an urgent fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions