Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 38 variants Io(Error), Media(SetupError), Transport(Error), Build(BuildError), IdentityAuthentication(AuthenticationError), Sdp(String), Profile(ProfileError), UnspecifiedMediaAddress, DtlsUnavailable, Dtls(String), DtlsSetup(SetupRoleError), DtlsEarlyMedia, DtlsRenegotiation, RtcpModeChange { current: RtcpMode, proposed: RtcpMode, }, NoResponse, Rejected { status: u16, reason: String, }, AuthenticationChallenge { status: u16, reason: String, challenge: Box<Challenge>, }, NoDialog, Cancelled(Duration), InvitationCancelled, InvalidDialogTag, SignallingTeardownTimeout(Duration), InvalidDialogResponse, NoReplaces, NoReferral, NoCommonCodec, IntervalTooBrief(Duration), SessionExpired, UnacknowledgedProvisional, NoEarlySession, StackOwnedDialogMethod(Method), ApplicationBodyTooLarge { actual: usize, limit: usize, }, ApplicationContentTypeRequired, ProtectedApplicationHeader(HeaderName), ApplicationFinalResponseRequired(u16), ApplicationResponseAlreadySent, ApplicationRuntimeUnavailable, DialogEnded,
}
Expand description

What can go wrong establishing or running a call.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Io(Error)

A socket failed.

§

Media(SetupError)

Negotiated media could not be constructed safely.

§

Transport(Error)

The transport failed.

§

Build(BuildError)

A message could not be built.

§

IdentityAuthentication(AuthenticationError)

A selected authentication service could not attest the outbound caller identity.

§

Sdp(String)

The SDP could not be read.

§

Profile(ProfileError)

A named browser-audio policy boundary refused setup or renegotiation.

§

UnspecifiedMediaAddress

SDP was asked to advertise an unspecified address which no peer can reach.

§

DtlsUnavailable

DTLS-SRTP was selected in a build that does not contain its handshake implementation.

§

Dtls(String)

A selected DTLS-SRTP media path could not be keyed.

§

DtlsSetup(SetupRoleError)

The DTLS setup exchange selected no role this endpoint can hold.

§

DtlsEarlyMedia

DTLS-SRTP was selected through an early-dialog API that cannot yet preserve its ordering.

§

DtlsRenegotiation

A running DTLS-SRTP call was asked to renegotiate without a rekeying exchange.

§

RtcpModeChange

An in-dialog description tried to change which sockets carry RTCP.

Fields

§current: RtcpMode

The mode owned by the running media session.

§proposed: RtcpMode

The mode the new offer/answer exchange selected.

§

NoResponse

The INVITE got no final response.

§

Rejected

The far end refused.

Fields

§status: u16

The status code.

§reason: String

Its reason phrase.

§

AuthenticationChallenge

A supported digest challenge returned by an INVITE attempt.

crate::dial and crate::dial_once consume this internally when credentials were supplied. It can surface from crate::dial_early, whose handle names one INVITE and therefore does not silently replace it with a retry.

Fields

§status: u16

The 401 or 407 status.

§reason: String

Its reason phrase.

§challenge: Box<Challenge>

The strongest supported challenge the response offered.

§

NoDialog

A 2xx that established no dialog — no To tag, or no Contact to send to.

§

Cancelled(Duration)

The caller gave up before the far end answered, and cancelled the invitation.

Distinct from a rejection: nobody refused the call, we stopped waiting for it.

§

InvitationCancelled

An invitation was answered after the caller had already withdrawn it (RFC 3261 §9.2).

The other side of Self::Cancelled: there, this stack gave up on an INVITE it sent; here, the far end gave up on one it sent us, the invitation was answered 487 Request Terminated, and there is nothing left to accept. Answering anyway would put a 200 on a transaction that has already finished and leave this side holding a call the caller does not have.

§

InvalidDialogTag

A caller-selected signalling-dialog tag was empty, overlong or not a SIP token.

The rejected value is deliberately absent: reflecting arbitrary application or fixture bytes in an error is unnecessary and makes it too easy to copy them into a log.

§

SignallingTeardownTimeout(Duration)

An originated BYE did not receive a final response inside its caller-owned failure bound.

§

InvalidDialogResponse

A final response to an originated BYE did not name that dialog and CSeq.

The mismatching values are intentionally absent so an untrusted packet is not reflected into logs by displaying this error.

§

NoReplaces

An INVITE asked to replace a dialog it did not name, or named one this is not.

Deliberately one error for both. Telling a caller “the Call-ID matched but the tags did not” would be telling them how far their guess got.

§

NoReferral

A transfer was accepted or refused when none had been asked for.

§

NoCommonCodec

Negotiation produced no usable audio stream.

§

IntervalTooBrief(Duration)

A 422 refused the session interval we asked for (RFC 4028 §6), naming its own minimum.

Carries the minimum rather than folding into Self::Rejected because the whole point of a 422 is that it is retryable, and only the value it carries makes the retry possible.

§

SessionExpired

The far end never refreshed the session, so it was torn down locally (RFC 4028 §10).

§

UnacknowledgedProvisional

A 2xx was asked for while a reliable provisional carrying SDP is unacknowledged.

RFC 3262 §5 makes the delay a MUST, and this is where it is enforced rather than silently deferred: a description sent in a provisional that never arrived, followed by a 200 that carries none, leaves the caller in a confirmed dialog with no answer at all. Keep feeding messages to Ringing::on_prack and try again.

§

NoEarlySession

An invitation was treated as having an early session when it never had one.

On the answering side: either it was rung with ring rather than ring_early, or it has already been answered — a Ringing hands its media port and its dialog over exactly once.

On the calling side, from Dialing::update: the far end has established a dialog but has not answered our offer in a reliable provisional, so RFC 3311 §5.1 does not yet allow an UPDATE to carry one. Dialing::has_early_session is the same question asked in advance.

§

StackOwnedDialogMethod(Method)

A stack-owned or unadmitted method was passed to the application-owned dialog API.

§

ApplicationBodyTooLarge

Application content exceeded the retained request-body bound.

Fields

§actual: usize

Observed body length.

§limit: usize

Maximum retained body length.

§

ApplicationContentTypeRequired

A non-empty application-owned body did not name its media type.

§

ProtectedApplicationHeader(HeaderName)

An application tried to supply a dialog- or transaction-owned header.

§

ApplicationFinalResponseRequired(u16)

An application response must end the transaction rather than being provisional.

§

ApplicationResponseAlreadySent

The request’s exactly-once response capability was already claimed.

§

ApplicationRuntimeUnavailable

A response capability could not capture the runtime that owns its transport work.

§

DialogEnded

An operation requiring a live dialog was attempted after call teardown.

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<AuthenticationError> for Error

Source§

fn from(source: AuthenticationError) -> Self

Converts to this type from the input type.
Source§

impl From<BuildError> for Error

Source§

fn from(source: BuildError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<ProfileError> for Error

Source§

fn from(source: ProfileError) -> Self

Converts to this type from the input type.
Source§

impl From<SetupError> for Error

Source§

fn from(source: SetupError) -> Self

Converts to this type from the input type.
Source§

impl From<SetupRoleError> for Error

Source§

fn from(source: SetupRoleError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,