Skip to content

Conversation

halseth
Copy link
Contributor

@halseth halseth commented Nov 6, 2017

This commit inspects the error from an RPC call, and
prints an encrypted wallet help text if the error has
status code Unimplemented. This is done to help a user
that is trying to issue lncli commands before unlocking
the wallet, since the RPC server won't be active and
every call will return this status code.

I chose not to explain the --noencryptwallet option,
as we want to move towards users encrypting their wallets.

@halseth halseth force-pushed the encrypted-wallet-helptext branch from 2364646 to 46e0fbf Compare November 9, 2017 19:08
This commit adds a decorator that will inspect the
error from an command action, and prints an encrypted
wallet help text if the error has status code Unimplemented.

This is done to help a user that is trying to issue
lncli commands before unlocking the wallet, since
the RPC server won't be active and every call will
return this status code.
@halseth halseth force-pushed the encrypted-wallet-helptext branch from 46e0fbf to d1e39e7 Compare November 9, 2017 19:10
Copy link
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

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

The tidiness of this change pleases me, LGTM 🎉


// actionDecorator is used to add additional information and error handling
// to command actions.
func actionDecorator(f func(*cli.Context) error) func(*cli.Context) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Great method name 👌

Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 👾

Very clean implementation as a result of the decorator 👍

@Roasbeef Roasbeef merged commit b7407cf into lightningnetwork:master Nov 12, 2017
@halseth halseth deleted the encrypted-wallet-helptext branch July 12, 2018 13:28
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.

3 participants