Skip to content

(fix) Improve error handling and output#781

Open
HarK-github wants to merge 3 commits into
hyperledger-labs:mainfrom
HarK-github:fix_error_messages
Open

(fix) Improve error handling and output#781
HarK-github wants to merge 3 commits into
hyperledger-labs:mainfrom
HarK-github:fix_error_messages

Conversation

@HarK-github

Copy link
Copy Markdown
Contributor

Fixes #758
This PR addresses minor hardcoded message discrepancies, improves error messaging specificity for config parsing failures, and refactors argument passing in fabric-docker.sh to prevent parameter truncation.

Changes:

Validation & Config:

  • Updated src/commands/validate/index.ts and src/config.ts to use a single source of truth (minFabricVersionRaft) for Raft consensus error messages instead of relying on a raw function reference layout.

Fablo Config Parser:

  • Enhanced src/utils/parseFabloConfig.ts to surface underlying error messages from both the JSON and YAML parser attempts. Added a corresponding unit test in parseFabloConfig.test.ts.

Templates & Scripts:

  • Refactored src/setup-docker/templates/fabric-docker.sh to use ${@:3} and ${@:2} syntax instead of strict positional assignments ($3 $4 $5...). This safely relays all extra arguments downstream to chaincode and channel commands.
  • Fixed a typo in chaincode-scripts.sh where a validation error for a chaincode invoke failure was mistakenly printing "Expected X parameters for chaincode list".

Tests:

  • New unit test passes verifying detailed parser error throwing.
  • Verified that dynamic arguments translate seamlessly to docker runtime routines.

Signed-off-by: Harshit Kandpal <kandpalhar@gmail.com>
… message improvements

Signed-off-by: Harshit Kandpal <kandpalhar@gmail.com>
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.

fix: incorrect error messages and exit codes across CLI and generated scripts

1 participant