forked from TrueCloudLab/frostfs-node
[#647] pkg/morph: Add constant var to err message
Use defined constant variable instead of hardcoded number in error message. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
4075bed068
commit
403f836968
1 changed files with 5 additions and 1 deletions
|
@ -140,7 +140,11 @@ func peerInfoFromStackItem(prm stackitem.Item) ([]byte, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("could not get stack item array (PeerInfo): %w", err)
|
return nil, fmt.Errorf("could not get stack item array (PeerInfo): %w", err)
|
||||||
} else if ln := len(prms); ln != nodeInfoFixedPrmNumber {
|
} else if ln := len(prms); ln != nodeInfoFixedPrmNumber {
|
||||||
return nil, fmt.Errorf("unexpected stack item count (PeerInfo): expected %d, has %d", 1, ln)
|
return nil, fmt.Errorf(
|
||||||
|
"unexpected stack item count (PeerInfo): expected %d, has %d",
|
||||||
|
nodeInfoFixedPrmNumber,
|
||||||
|
ln,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return client.BytesFromStackItem(prms[0])
|
return client.BytesFromStackItem(prms[0])
|
||||||
|
|
Loading…
Reference in a new issue