Skip to content

Commit

Permalink
chore: be more verbose in errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fiksn committed Oct 26, 2022
1 parent 824ae08 commit 3fb7e28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions cmd/balance-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@ func infoCallback(ctx context.Context, report *agent_entities.InfoReport) bool {
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated {
glog.Warningf("Status was not OK but, %d", resp.StatusCode)
if glog.V(2) {
glog.V(2).Infof("Failed to send out callback %s", string(rep))
defer resp.Body.Close()
bodyData, _ := ioutil.ReadAll(resp.Body)
glog.V(2).Infof("Failed to send out callback %s, server said %s", string(rep), string(bodyData))
}
return false
}
Expand Down Expand Up @@ -435,7 +437,9 @@ func balanceCallback(ctx context.Context, report *agent_entities.ChannelBalanceR
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated {
glog.Warningf("Status was not OK but, %d", resp.StatusCode)
if glog.V(2) {
glog.V(2).Infof("Failed to send out callback %s", string(rep))
defer resp.Body.Close()
bodyData, _ := ioutil.ReadAll(resp.Body)
glog.V(2).Infof("Failed to send out callback %s, server said %s", string(rep), string(bodyData))
}
return false
}
Expand Down
2 changes: 1 addition & 1 deletion lightning_api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ type NodeInfoApi struct {
Node DescribeGraphNodeApi `json:"node,omitempty"`
Channels []NodeChannelApi `json:"channels"`
NumChannels uint32 `json:"num_channels"`
TotalCapacity uint64 `json:"total_capacity,omitempty"`
TotalCapacity uint64 `json:"total_capacity"`
}

type NodeChannelApiExtended struct {
Expand Down

0 comments on commit 3fb7e28

Please sign in to comment.