feat(Controller): Added error logging in update loop

This commit is contained in:
2025-08-04 15:42:19 +02:00
parent 945a78c463
commit cc7f355629
2 changed files with 15 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
package main
import (
"log"
"gitlab.com/gomidi/midi/v2"
"github.com/bendahl/uinput"
)
@@ -53,6 +55,9 @@ func (c Controller) Stop() {
func (c Controller) update(msg midi.Message) {
for _, mapping := range c.mappings {
mapping.TriggerIfMatch(msg, c.virtGamepad)
err := mapping.TriggerIfMatch(msg, c.virtGamepad)
if err != nil {
log.Printf("Error in Mapping \"%s\": %v\n", mapping.Comment(), err)
}
}
}