1
0
Fork 0
mirror of https://github.com/Luzifer/streamdeck.git synced 2024-12-20 17:51:21 +00:00

Fix: Use proper context for delayed errors

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2020-11-14 21:11:45 +01:00
parent 5ee7785103
commit 2ada7060ee
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

View file

@ -231,15 +231,16 @@ func togglePage(page string) error {
} }
go func(idx int, kd keyDefinition) { go func(idx int, kd keyDefinition) {
localCtx := activePageCtx
keyLogger := log.WithFields(log.Fields{ keyLogger := log.WithFields(log.Fields{
"key": idx, "key": idx,
"page": activePageName, "page": activePageName,
}) })
if err := callDisplayElement(activePageCtx, idx, kd); err != nil { if err := callDisplayElement(localCtx, idx, kd); err != nil {
keyLogger.WithError(err).Error("Unable to execute display element") keyLogger.WithError(err).Error("Unable to execute display element")
if err := callErrorDisplayElement(activePageCtx, idx); err != nil { if err := callErrorDisplayElement(localCtx, idx); err != nil {
keyLogger.WithError(err).Error("Unable to execute error display element") keyLogger.WithError(err).Error("Unable to execute error display element")
} }
} }