fix: log invalid signals received

This commit is contained in:
Richard Ramos 2020-07-16 18:25:57 -04:00 committed by Iuri Matias
parent 955826d6de
commit 8dc7f1dd62
1 changed files with 8 additions and 2 deletions

View File

@ -38,8 +38,14 @@ QtObject:
self.signalSubscribers[signalType].add(subscriber)
proc processSignal(self: SignalsController) =
let jsonSignal = (self.statusSignal).parseJson
let signalString = $jsonSignal["type"].getStr
var jsonSignal:JsonNode
try:
jsonSignal = self.statusSignal.parseJson
except:
error "Invalid signal received", data = self.statusSignal
return
let signalString = jsonSignal["type"].getStr
trace "Raw signal data", data = $jsonSignal