error properly when lbcd fails to connect in HTTP POST mode #99

Merged
lyoshenka merged 1 commit from connection-failure into master 2022-10-14 20:40:46 +02:00
lyoshenka commented 2022-10-14 20:17:51 +02:00 (Migrated from github.com)

in the case where you're e.g. trying to connect to an invalid address, the err vars in handleSendPostMessage() were being shadowed inside the for loop. if c.httpClient.Do() returned an error, that error never got returned upstream. then ioutil.ReadAll(httpResponse.Body) would get a nil pointer dereference.

this fixes that case.

in the case where you're e.g. trying to connect to an invalid address, the err vars in `handleSendPostMessage()` were being shadowed inside the for loop. if `c.httpClient.Do()` returned an error, that error never got returned upstream. then `ioutil.ReadAll(httpResponse.Body)` would get a nil pointer dereference. this fixes that case.
coveralls commented 2022-10-14 20:23:08 +02:00 (Migrated from github.com)

Pull Request Test Coverage Report for Build 3252072246

  • 0 of 4 (0.0%) changed or added relevant lines in 1 file are covered.
  • 14 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.02%) to 51.101%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rpcclient/infrastructure.go 0 4 0.0%
Files with Coverage Reduction New Missed Lines %
integration/rpctest/blockgen.go 2 83.78%
btcec/signature.go 3 92.82%
peer/peer.go 9 75.92%
Totals Coverage Status
Change from base Build 3200324786: -0.02%
Covered Lines: 22494
Relevant Lines: 44019

💛 - Coveralls
## Pull Request Test Coverage Report for [Build 3252072246](https://coveralls.io/builds/53290398) * **0** of **4** **(0.0%)** changed or added relevant lines in **1** file are covered. * **14** unchanged lines in **3** files lost coverage. * Overall coverage decreased (**-0.02%**) to **51.101%** --- | Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | | :-----|--------------|--------|---: | | [rpcclient/infrastructure.go](https://coveralls.io/builds/53290398/source?filename=rpcclient%2Finfrastructure.go#L777) | 0 | 4 | 0.0% <!-- | **Total:** | **0** | **4** | **0.0%** | --> | Files with Coverage Reduction | New Missed Lines | % | | :-----|--------------|--: | | [integration/rpctest/blockgen.go](https://coveralls.io/builds/53290398/source?filename=integration%2Frpctest%2Fblockgen.go#L43) | 2 | 83.78% | | [btcec/signature.go](https://coveralls.io/builds/53290398/source?filename=btcec%2Fsignature.go#L398) | 3 | 92.82% | | [peer/peer.go](https://coveralls.io/builds/53290398/source?filename=peer%2Fpeer.go#L1705) | 9 | 75.92% | <!-- | **Total:** | **14** | | --> | Totals | [![Coverage Status](https://coveralls.io/builds/53290398/badge)](https://coveralls.io/builds/53290398) | | :-- | --: | | Change from base [Build 3200324786](https://coveralls.io/builds/53075181): | -0.02% | | Covered Lines: | 22494 | | Relevant Lines: | 44019 | --- ##### 💛 - [Coveralls](https://coveralls.io)
roylee17 (Migrated from github.com) approved these changes 2022-10-14 20:40:34 +02:00
roylee17 (Migrated from github.com) left a comment

LGTM, thx.

LGTM, thx.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbcd#99
No description provided.