diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-12-03 01:29:19 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-12-03 01:35:43 +0900 |
| commit | c34439fc5fe52db3f346131bd6398da8a69fe0bf (patch) | |
| tree | 57ae75188a59345416899c49186638e083147bc3 /internal/pipewire/client.go | |
| parent | 32fb137bb2e6eed465e94fd791abfaaab40bf674 (diff) | |
internal/pipewire: collect non-protocol errors
These errors are recoverable and should not terminate event handling. Only terminate event handling for protocol errors or inconsistent state that makes further event handling impossible.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pipewire/client.go')
| -rw-r--r-- | internal/pipewire/client.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/internal/pipewire/client.go b/internal/pipewire/client.go index 7c619ca8..8e901d8e 100644 --- a/internal/pipewire/client.go +++ b/internal/pipewire/client.go @@ -94,14 +94,12 @@ type Client struct { Properties SPADict `json:"props"` } -func (client *Client) consume(opcode byte, files []int, unmarshal func(v any) error) error { - if err := closeReceivedFiles(files...); err != nil { - return err - } - +func (client *Client) consume(opcode byte, files []int, unmarshal func(v any)) error { + closeReceivedFiles(files...) switch opcode { case PW_CLIENT_EVENT_INFO: - return unmarshal(&client.Info) + unmarshal(&client.Info) + return nil default: return &UnsupportedOpcodeError{opcode, client.String()} |
