Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Better bootnodes option error message #1092

Conversation

NicolasMassart
Copy link
Contributor

PR description

change --bootnodes option to a method to be able to handle the check and error

Handling this as a method enables to keep the parameter as a string and not a
strongly typed value. It then is always accepted by the command line so it's
always considered as a param and doesn't raise an unknown param error but also
immediately checked against the enode pattern and intelligible matching error
is displayed.

Converter is removed and only a simple lambda is used in a try block
leaving the handling of the error message close to the option thus making code
easier to understand. Anyway, as we use a Collection of Strings as input no
converter is needed anymore.

Update and add tests to check non regression and handle the new behaviour.
Also this change can change the order in which options are handled in the spec.
So tests are updated to check for the presence of options but not specifying a
static order. verifyOptionsConstraintLoggerCall now loops trough the options
to check they are contained in the error string but not in a specific order.

Fixed Issue(s)

fixes PAN-2387 and PAN-2015

…and error

Handling this as a method enables to keep the parameter as a string and not a
strongly typed value. It then is always accepted by the command line so it's
always considered as a param and doesn't raise an unknown param error but also
immediately checked against the enode pattern and intelligible matching error
is displayed.

Converter is removed and only a simple lambda is used in a try block
leaving the handling of the error message close to the option thus making code
easier to understand. Anyway, as we use a Collection of Strings as input no
converter is needed anymore.

Update and add tests to check non regression and handle the new behaviour.
Also this change can change the order in which options are handled in the spec.
So tests are updated to check for the presence of options but not specifying a
static order. verifyOptionsConstraintLoggerCall now loops trough the options
to check they are contained in the error string but not in a specific order.
@NicolasMassart NicolasMassart added bug Something isn't working api Related to public APIs labels Mar 13, 2019
@NicolasMassart NicolasMassart self-assigned this Mar 13, 2019
@NicolasMassart NicolasMassart changed the title Fix/pan 2387 bootnodes option error msg Better bootnodes option error message Mar 13, 2019
Copy link
Contributor

@lucassaldanha lucassaldanha left a comment

Choose a reason for hiding this comment

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

LGTM. Minor suggestion on a test method naming.

Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

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

Yep LGTM.

@NicolasMassart NicolasMassart merged commit 88521e2 into PegaSysEng:master Mar 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api Related to public APIs bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants