Enforce error handling and checking type assertions (#5403)

* Enforce error handling and checking type assertions
* Reference issue #5404 in the TODO message
* doc description
* Merge branch 'master' into errcheck
* fix tests and address @nisdas feedbacK
* gaz
* fix docker image
This commit is contained in:
Preston Van Loon
2020-04-12 21:11:09 -07:00
committed by GitHub
parent a85bf9305d
commit d5ddd012bc
88 changed files with 1088 additions and 169 deletions

View File

@@ -86,7 +86,11 @@ func (s *Service) Start() {
select {
case event := <-stateChannel:
if event.Type == statefeed.Initialized {
data := event.Data.(*statefeed.InitializedData)
data, ok := event.Data.(*statefeed.InitializedData)
if !ok {
log.Error("Event feed data is not type *statefeed.InitializedData")
continue
}
log.WithField("starttime", data.StartTime).Debug("Received state initialized event")
genesis = data.StartTime
genesisSet = true