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
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.
Malformed
NotFound
InvalidCredentials
Wrong username or password; deliberately the same for both.
RateLimited
Too many requests: failed sign-ins for this username or from this endpoint, or more operations than a pool has room for now.
CannotPlay
The client cannot play this selection; one reason per stream, as
in PlaybackPlan::Unsupported.
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.
PlaybackFailed
The encode for this playback failed; reason is ffmpeg’s.
PlaybackRestarted
The read names an encode that a seek replaced; read epoch from
offset 0.
SubtitleNotReady
The subtitle is still being read as text; done_percent of
its cues are read. Ask again in a few seconds.
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.
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.
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.
Something the server depends on (Plex, a media mount) is down.
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.
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.
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.
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.
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
reason: PairingRefusedOriginOffline
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<'de> Deserialize<'de> for Error
impl<'de> Deserialize<'de> for Error
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()