in operationsbus/matcher.go [52:70]
func (m *Matcher) CreateEntityInstance(key string, lastOperationId string) (Entity, error) {
if lastOperationId == "" {
return nil, errors.New("lastOperationId is empty!")
}
var entity Entity
if f, ok := m.EntityCreators[key]; ok {
entity = f(lastOperationId)
} else {
return nil, errors.New("Something went wrong getting the value of key: " + key)
}
if entity == nil {
return nil, errors.New("Entity was not created successfully!")
}
return entity, nil
}