upgrade osc-go library to v0.3.0 and handle new error cases

This commit is contained in:
Joel Wetzell
2026-04-14 07:28:06 -05:00
parent 36b085ef5c
commit f969d3484d
5 changed files with 19 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ package processor
import (
"context"
"errors"
"fmt"
osc "github.com/jwetzell/osc-go"
"github.com/jwetzell/showbridge-go/internal/common"
@@ -22,7 +23,12 @@ func (ome *OSCMessageEncode) Process(ctx context.Context, wrappedPayload common.
return wrappedPayload, errors.New("osc.message.encode processor only accepts an *OSCMessage")
}
wrappedPayload.Payload = payloadMessage.ToBytes()
bytes, err := payloadMessage.ToBytes()
if err != nil {
wrappedPayload.End = true
return wrappedPayload, fmt.Errorf("osc.message.encode processor failed to encode OSCMessage: %w", err)
}
wrappedPayload.Payload = bytes
return wrappedPayload, nil
}