describeMediaSocketError function

String describeMediaSocketError(
  1. Object? error, {
  2. String fallback = 'Unable to connect. Check your credentials and try again.',
})

User-facing text for any connection error; fallback for errors that are not MediaSocketConnectException.

Implementation

String describeMediaSocketError(Object? error,
        {String fallback =
            'Unable to connect. Check your credentials and try again.'}) =>
    error is MediaSocketConnectException ? error.userMessage : fallback;