Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 57 variants StaleProgress, ServerRestarted, OperationExpired, OperationConflict, RevisionConflict { revision: u64, }, HandshakeRequired, Unauthenticated, Unsupported { request: String, }, Malformed { message: String, }, NotFound { what: String, }, InvalidCredentials, RateLimited { retry_after_ms: u64, }, CannotPlay { reasons: Vec<String>, }, PlaybackExpired, PlaybackStopped, Busy, WanStreamsFull { max: u32, }, PlaybackFailed { reason: String, }, PlaybackRestarted { epoch: u32, }, SubtitleNotReady { done_percent: u8, }, PreviewsNotReady { done_percent: u8, }, NoPreviews, SubtitleChanged, ProfileLocked, InvalidInput { message: String, }, NoPassword, RecentSignInRequired, LastSignInMethod, DeviceSignInDenied, DeviceSignInExpired, ReplyTooLarge { bytes: u64, }, Unavailable { message: String, }, NotSetUp, WrongInviteKind, InviteInvalid, InviteExpired, InviteExhausted, UsernameTaken, TieChallengeExpired, PortableIdTaken, NotForPortableUsers, AdminRequired, PasswordChangeRequired, LastAdmin, PlaylistReadOnly, KindNotAllowed { kind: ItemKind, }, PlaylistConflict { revision: u64, }, NotAllowed, ImageTooLarge { max_bytes: u64, max_pixels: u64, }, ImageUnreadable, QuotaExhausted { whose: QuotaOf, resets_at: Option<i64>, site: Option<String>, }, NoSubtitleSource, DownloadNotReady, PairingRefused { reason: PairingRefused, }, OriginOffline, Internal, Unknown,
}
Expand description

Why a request failed. Typed, so clients act on the kind, not on text.

Variants§

§

StaleProgress

§

ServerRestarted

§

OperationExpired

§

OperationConflict

§

RevisionConflict

Fields

§revision: u64
§

HandshakeRequired

The connection’s first request was not Hello.

§

Unauthenticated

The request needs a session, and none valid for this endpoint was given.

§

Unsupported

The server does not know this request type.

Fields

§request: String
§

Malformed

Fields

§message: String
§

NotFound

Fields

§what: String
§

InvalidCredentials

Wrong username or password; deliberately the same for both.

§

RateLimited

Too many failed logins for this username or from this endpoint.

Fields

§retry_after_ms: u64
§

CannotPlay

The client cannot play this selection; one reason per stream, as in PlaybackPlan::Unsupported.

Fields

§reasons: Vec<String>
§

PlaybackExpired

The playback handle is unknown or has been idle too long. Call StartPlayback again and go on from where playback was.

§

PlaybackStopped

An admin stopped the playback on the server. It is over: tell the viewer it ended, and do not start it again on your own as after PlaybackExpired. Its progress is kept.

§

Busy

The server is converting as many files as it may at once.

§

WanStreamsFull

The server plays at most max playbacks off its LAN at once (network.uplink.max_streams), and that many are playing. Try again when one ends; a device on the server’s LAN is not counted.

Fields

§max: u32
§

PlaybackFailed

The encode for this playback failed; reason is ffmpeg’s.

Fields

§reason: String
§

PlaybackRestarted

The read names an encode that a seek replaced; read epoch from offset 0.

Fields

§epoch: u32
§

SubtitleNotReady

The subtitle is still being read as text; done_percent of its cues are read. Ask again in a few seconds.

Fields

§done_percent: u8
§

PreviewsNotReady

The item’s frame previews are being made; done_percent of them are. Ask again in a few seconds; show the time alone till then.

Fields

§done_percent: u8
§

NoPreviews

The item has no frame previews and will not have: music, a file they could not be made of, or a server that makes none. Do not ask again for this item.

§

SubtitleChanged

The subtitle is not the file that ReadSubtitle’s version names: it was written again or replaced since that chunk. Read it again from offset 0.

§

ProfileLocked

The session’s profile is locked on this connection: UnlockProfile with the user’s PIN first.

§

InvalidInput

A value the request carries is not acceptable (a PIN that is not 4 to 8 digits, say); the message says why.

Fields

§message: String
§

NoPassword

The request carried the user’s account password, and they have none: they sign in with a passkey or SSO only (a PinProof::Password). Not a wrong password, and nothing was counted. Use another proof, or send them to the server’s web UI (ServerInfo::web_url, when the server has one).

§

RecentSignInRequired

The session was signed in too long ago for this (an app passkey, approving a device): confirm it is the user (ConfirmPassword, or BeginConfirmPasskey), or sign in again, then ask again. Nothing was changed.

§

LastSignInMethod

Removing this would leave the user no way to sign in: it is their only passkey, and they have no password or linked sign-in provider (RemovePasskey). Nothing was changed.

§

DeviceSignInDenied

The device sign-in was refused on the approving device.

§

DeviceSignInExpired

The device sign-in is over: it timed out, or is not this device’s. Begin a new one.

§

ReplyTooLarge

The reply would be over the frame limit (crate::codec::MAX_FRAME); bytes is its length. A page of items is to ask for in smaller pages.

Fields

§bytes: u64
§

Unavailable

Something the server depends on (Plex, a media mount) is down.

Fields

§message: String
§

NotSetUp

The server has no library yet: it is waiting to be set up in its web UI. Every catalog and playback request gets this until it is; show “This server is not set up yet”, not an error. Signing in and the rest work.

§

WrongInviteKind

The invite’s code is right, and it is of another kind than the request redeems: a portable-account invite’s code to RedeemInvite, or a create-user one’s to RedeemPortableInvite. Nothing was made and the invite keeps its use: redeem it the other way.

§

InviteInvalid

RedeemInvite with a code that is no invite’s, or whose invite was revoked. Counted as a wrong guess. Offer “Save server only”, which pins the server as a link without a code does.

§

InviteExpired

The invite’s code is right, and it has expired: ask for another.

§

InviteExhausted

The invite’s code is right, and every account it could make has been made: ask for another.

§

UsernameTaken

Someone on this server has that username: pick another. Nothing was made and the invite was not used up.

§

TieChallengeExpired

TieFinish with a nonce that is not outstanding for this session: it was used, it is over, or TieBegin never gave it here. Begin again.

§

PortableIdTaken

Another account on this server is tied to that portable identity: one identity ties to one account per server. Sever that tie first. Nothing was changed.

§

NotForPortableUsers

The session is a portable user’s, and this is for an account here only: its password, PIN, passkeys, devices, sessions, ties, approving sign-ins. Hide what asks for it while signed in as one. Nothing was changed.

§

AdminRequired

The request is an admin’s (making and revoking invites), and the session user is not one. Nothing was changed.

§

PasswordChangeRequired

The session was opened with a one-time password an admin reset to: it may only ChangePassword (or Logout, WhoAmI) until the user chooses a new password. Nothing was done.

§

LastAdmin

LeaveServer from the last enabled admin, or the last enabled admin with a password: make someone else an admin, or give one a password, first. Nothing was changed.

§

PlaylistReadOnly

The user sees the playlist and may not make this change: an edit on a read-only share, or a rename, sharing change or delete by anyone but its owner (or an admin, for a server-wide one). Nothing was changed.

§

KindNotAllowed

The playlist does not take items of this kind: its kinds were ticked when it was made. Nothing was changed. A season or show is episodes, an album or artist tracks.

Fields

§

PlaylistConflict

Someone changed the playlist since the revision the edit was made on, and touched an entry the edit touches: “Someone changed this playlist; reload”. revision is its revision now. Nothing was changed.

Fields

§revision: u64
§

NotAllowed

The user may not do this to what they see: a cover set or taken away by someone who may not edit the playlist, or on Liked or All, whose tiles are fixed. Nothing was changed.

§

ImageTooLarge

The picture is over max_bytes long, or over max_pixels by its header. Refused before it was decoded; nothing was changed.

Fields

§max_bytes: u64
§max_pixels: u64
§

ImageUnreadable

Not a JPEG, PNG, WebP or HEIC picture the server can decode, or one that hit the decoder’s limits. Nothing was changed.

§

QuotaExhausted

The downloads of whose are used up for today: the server’s account at subtitle site site (opensubtitles, subdl, as SubtitleResult::source), or the user’s own daily limit on this server (no site). resets_at (Unix seconds) is when more may be downloaded, when known. Nothing was downloaded; searching still works.

Fields

§whose: QuotaOf
§resets_at: Option<i64>
§

NoSubtitleSource

The server has no subtitle site set up: hide “Find subtitles”. Nothing was asked of any site.

§

DownloadNotReady

The download’s file is not whole yet: read it once its state is ready. A download that failed is prepared again.

§

PairingRefused

Experimental (federation): the other server did not pair (PairServer), for reason. Nothing was kept.

Fields

§

OriginOffline

Experimental (federation): the paired server the item is from is offline to this one (RemoteGrant): play it from this server, or later.

§

Internal

§

Unknown

An error type this build does not know.

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Error

Source§

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

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

impl<'de> Deserialize<'de> for Error

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. 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 Eq for Error

Source§

impl Error for Error

1.30.0 · 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 PartialEq for Error

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Error

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Error

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.