The sessionError event in the playbackSession namespace indicates the session error status, such as failures to join and evictions.


Parameters

See the Control documentation for descriptions of parameters in the header. See the table below for descriptions of parameters in the body.

ParametersTypeValue
errorCodestringThe session error. See the list below.
reasonstringThe reason for the error. This string is optional, so it may not always be returned. It is in English and not localized. Your app should only use it for debugging purposes.
sessionIdstringThe identifier for the session.

Session Errors

ValueDefinition
ERROR_SESSION_IN_PROGRESSIndicates that your app could not establish a session. This can occur if there is an existing session or if any other source is currently playing.
ERROR_SESSION_JOIN_FAILEDIndicates that your app did not successfully join an existing session. This can occur if the appId and appContext doesn’t match the session your app is attempting to join or if there is no current session.
ERROR_SESSION_EVICTEDIndicates that the session ended and your app was kicked out. This can occur if another app created a new session or if your app selected a different playback source. Sonos delivers this error to all subscribers of the existing session.

Example

{
  "errorCode": "ERROR_SESSION_EVICTED",
  "reason": "Another user joined the session."
}