forked from cwtch.im/cwtch
Force Error Log if NewEventList attempts to publish an invalid field
This commit is contained in:
parent
2bbe0c48d6
commit
9605894463
|
@ -46,6 +46,8 @@ func NewEventList(eventType Type, args ...interface{}) Event {
|
||||||
val, vok := args[i+1].(string)
|
val, vok := args[i+1].(string)
|
||||||
if kok && vok {
|
if kok && vok {
|
||||||
data[key] = val
|
data[key] = val
|
||||||
|
} else {
|
||||||
|
log.Errorf("attempted to send a field that could not be parsed to a string: %v %v", args[i], args[i+1])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Event{EventType: eventType, EventID: GetRandNumber().String(), Data: data}
|
return Event{EventType: eventType, EventID: GetRandNumber().String(), Data: data}
|
||||||
|
|
Loading…
Reference in New Issue