#[non_exhaustive]pub enum SteamError {
Show 22 variants
SteamResult(EResult),
ConnectionError(String),
AlreadyLoggedOn,
AlreadyConnecting,
NotLoggedOn,
NotConnected,
InvalidCredentials,
SteamGuardRequired {
guard_type: EAuthSessionGuardType,
email_domain: Option<String>,
},
TwoFactorRequired,
InvalidToken(String),
NetworkError(Error),
Timeout,
ResponseTimeout,
DeserializationFailed,
ProtocolError(String),
BadResponse {
message: String,
emsg: Option<EMsg>,
raw_bytes: Option<Vec<u8>>,
},
SessionError(SessionError),
NotImplemented(String),
Reqwest(Error),
WebSocket(Error),
Decode(DecodeError),
Other(String),
}Expand description
Errors that can occur when using the Steam client.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SteamResult(EResult)
Steam returned an error result.
ConnectionError(String)
Connection error.
AlreadyLoggedOn
Already logged on.
AlreadyConnecting
Already connecting.
NotLoggedOn
Not logged on.
NotConnected
Not connected.
InvalidCredentials
Invalid credentials.
SteamGuardRequired
Steam Guard authentication required.
This error is returned when password authentication requires a Steam
Guard code. The guard_type indicates what kind of code is needed:
EmailCode: A code sent to the account’s emailDeviceCode: A TOTP code from the Steam mobile appDeviceConfirmation: Approval via the Steam mobile app
Fields
guard_type: EAuthSessionGuardTypeType of Steam Guard verification needed.
TwoFactorRequired
Two-factor authentication required (legacy).
InvalidToken(String)
Invalid token.
NetworkError(Error)
Network error.
Timeout
Timeout.
ResponseTimeout
Response timed out.
DeserializationFailed
Deserialization failed.
ProtocolError(String)
Protocol error.
BadResponse
Bad response from Steam.
This error is returned when Steam returns a malformed response or one that violates expectations (e.g. missing SteamID in logon response).
Fields
SessionError(SessionError)
Session error.
NotImplemented(String)
Not implemented yet.
Reqwest(Error)
HTTP/Reqwest error (transparent — preserves source() chain).
WebSocket(Error)
WebSocket transport error (transparent — preserves source() chain).
Decode(DecodeError)
Protobuf decode error (transparent — preserves source() chain).
Other(String)
Other error.
Implementations§
Source§impl SteamError
impl SteamError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns true if the error is a transient error that might be resolved by retrying.
Matches Node.js behavior for handling:
- Fail
- ServiceUnavailable
- TryAnotherCM
- NoConnection (in logoff context)
Sourcepub fn bad_response(message: impl Into<String>) -> Self
pub fn bad_response(message: impl Into<String>) -> Self
Create a BadResponse error with just a message (backwards-compatible shorthand).
Trait Implementations§
Source§impl Debug for SteamError
impl Debug for SteamError
Source§impl Display for SteamError
impl Display for SteamError
Source§impl Error for SteamError
impl Error for SteamError
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()
Source§impl From<CmError> for SteamError
impl From<CmError> for SteamError
Source§impl From<DecodeError> for SteamError
impl From<DecodeError> for SteamError
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Source§impl From<Error> for SteamError
impl From<Error> for SteamError
Source§impl From<Error> for SteamError
impl From<Error> for SteamError
Source§impl From<Error> for SteamError
impl From<Error> for SteamError
Source§impl From<SessionError> for SteamError
impl From<SessionError> for SteamError
Source§fn from(source: SessionError) -> Self
fn from(source: SessionError) -> Self
Auto Trait Implementations§
impl !Freeze for SteamError
impl !RefUnwindSafe for SteamError
impl Send for SteamError
impl Sync for SteamError
impl Unpin for SteamError
impl UnsafeUnpin for SteamError
impl !UnwindSafe for SteamError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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