mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-04 07:07:13 +00:00
light: fix provider error plumbing (#7610)
The custom error types in the provider package did not propagate their wrapped underlying reasons, making it difficult for the test to check that the correct error was observed. - Fix the custom errors to have a true underlying error (not just a string). - Add Unwrap methods to support inspection by errors.Is. - Update usage in a few places. - Fix the test to check for acceptable variation. Fixes #7609.
This commit is contained in:
@@ -195,7 +195,7 @@ func (p *BlockProvider) LightBlock(ctx context.Context, height int64) (*types.Li
|
||||
case errPeerAlreadyBusy:
|
||||
return nil, provider.ErrLightBlockNotFound
|
||||
default:
|
||||
return nil, provider.ErrUnreliableProvider{Reason: err.Error()}
|
||||
return nil, provider.ErrUnreliableProvider{Reason: err}
|
||||
}
|
||||
|
||||
// check that the height requested is the same one returned
|
||||
|
||||
Reference in New Issue
Block a user