Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cli/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ func infoCmdAct(cctx *cli.Context) error {
chs, err := fullapi.PaychList(ctx)
if err != nil {
// Check if the error is because payment channel manager is disabled
if errors.Is(err, paych.ErrPaymentChannelDisabled) {
// Use both errors.Is and string comparison for robustness
if errors.Is(err, paych.ErrPaymentChannelDisabled) ||
strings.Contains(err.Error(), "payment channels disabled") {
fmt.Printf("Payment Channels: disabled (EnablePaymentChannelManager is set to false)\n")
} else {
return err
Expand Down
2 changes: 1 addition & 1 deletion node/impl/paych/paych.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func (a *PaychImpl) PaychVoucherSubmit(ctx context.Context, ch address.Address,

// ErrPaymentChannelDisabled is returned when payment channel operations are attempted
// but the payment channel manager is disabled in the configuration.
var ErrPaymentChannelDisabled = xerrors.New("payment channel manager is disabled (EnablePaymentChannelManager is set to false)")
var ErrPaymentChannelDisabled = xerrors.New("payment channels disabled (EnablePaymentChannelManager=false)")

// DisabledPaych is a stub implementation of the PaychAPI interface that returns errors for all
// methods. It is used when the payment channel manager is disabled (e.g., when
Expand Down
Loading