internal/pipewire: handle Core::Error
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m37s
Test / Sandbox (race detector) (push) Successful in 4m40s
Test / Hakurei (push) Successful in 4m59s
Test / Hpkg (push) Successful in 5m2s
Test / Hakurei (race detector) (push) Successful in 6m24s
Test / Flake checks (push) Successful in 1m28s
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m37s
Test / Sandbox (race detector) (push) Successful in 4m40s
Test / Hakurei (push) Successful in 4m59s
Test / Hpkg (push) Successful in 5m2s
Test / Hakurei (race detector) (push) Successful in 6m24s
Test / Flake checks (push) Successful in 1m28s
This event is not encountered in the pw-container sample, but already has existing sample from an excerpt. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
af741f20a0
commit
e7a665e043
@ -206,6 +206,14 @@ type CoreError struct {
|
||||
Message String `json:"message"`
|
||||
}
|
||||
|
||||
func (c *CoreError) Error() string {
|
||||
return "received Core::Error on" +
|
||||
" id " + strconv.Itoa(int(c.ID)) +
|
||||
" seq " + strconv.Itoa(int(c.Sequence)) +
|
||||
" res " + strconv.Itoa(int(c.Result)) +
|
||||
": " + c.Message
|
||||
}
|
||||
|
||||
// Size satisfies [KnownSize] with a value computed at runtime.
|
||||
func (c *CoreError) Size() Word {
|
||||
return SizePrefix +
|
||||
@ -543,6 +551,13 @@ func (core *Core) consume(opcode byte, files []int, unmarshal func(v any) error)
|
||||
// anything, and this behaviour is never mentioned in documentation
|
||||
return nil
|
||||
|
||||
case PW_CORE_EVENT_ERROR:
|
||||
var coreError CoreError
|
||||
if err := unmarshal(&coreError); err != nil {
|
||||
return err
|
||||
}
|
||||
return &coreError
|
||||
|
||||
case PW_CORE_EVENT_BOUND_PROPS:
|
||||
var boundProps CoreBoundProps
|
||||
if err := unmarshal(&boundProps); err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user