forked from TrueCloudLab/frostfs-node
[#1693] node: Replace conditional panics with asserts
Change-Id: I5024705fd1693d00cb9241235030a73984c2a7e1 Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
This commit is contained in:
parent
410b6f70ba
commit
a285d8924f
1 changed files with 2 additions and 3 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
"net"
|
||||
"sync/atomic"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/assert"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/netmap"
|
||||
|
@ -104,9 +105,7 @@ func (s *networkState) getNodeInfo() (res netmapSDK.NodeInfo, ok bool) {
|
|||
v := s.nodeInfo.Load()
|
||||
if v != nil {
|
||||
res, ok = v.(netmapSDK.NodeInfo)
|
||||
if !ok {
|
||||
panic(fmt.Sprintf("unexpected value in atomic node info state: %T", v))
|
||||
}
|
||||
assert.True(ok, fmt.Sprintf("unexpected value in atomic node info state: %T", v))
|
||||
}
|
||||
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue