pub enum NetDiskError {
Show 20 variants
HttpError {
status_code: u16,
url: String,
source: Option<Error>,
},
ApiError {
errno: i32,
errmsg: String,
},
AuthError {
description: String,
},
FileExists {
path: String,
},
FileNotFound {
path: String,
},
DirectoryNotFound {
path: String,
},
IoError(Error),
JsonError(Error),
UrlEncodeError(String),
UrlParseError(ParseError),
Timeout,
Cancelled,
InvalidParameter {
message: String,
},
TokenExpired,
SyncError(String),
InvalidHeaderValue(String),
ReqwestError(Error),
MpscSendError(String),
JoinError(JoinError),
Unknown {
message: String,
},
}Expand description
SDK error types
Variants§
HttpError
HTTP request error
ApiError
API business error
AuthError
Authentication error
FileExists
File already exists
FileNotFound
File not found
DirectoryNotFound
Directory not found
IoError(Error)
IO error
JsonError(Error)
JSON parsing error
UrlEncodeError(String)
URL encoding error
UrlParseError(ParseError)
URL parsing error
Timeout
Request timeout
Cancelled
Request cancelled
InvalidParameter
Invalid parameter
TokenExpired
Token expired
SyncError(String)
Synchronization primitive error
InvalidHeaderValue(String)
Invalid header value
ReqwestError(Error)
Reqwest HTTP client error
MpscSendError(String)
MPSC send error
JoinError(JoinError)
Join error (task join error)
Unknown
Unknown error
Implementations§
Source§impl NetDiskError
impl NetDiskError
Sourcepub fn http_error(status_code: u16, url: &str) -> Self
pub fn http_error(status_code: u16, url: &str) -> Self
Create HTTP error
Sourcepub fn http_error_with_source(
status_code: u16,
url: &str,
source: Error,
) -> Self
pub fn http_error_with_source( status_code: u16, url: &str, source: Error, ) -> Self
Create HTTP error with source
Sourcepub fn api_error(errno: i32, errmsg: &str) -> Self
pub fn api_error(errno: i32, errmsg: &str) -> Self
Create API error with standard error description
Sourcepub fn api_error_raw(errno: i32, errmsg: &str) -> Self
pub fn api_error_raw(errno: i32, errmsg: &str) -> Self
Create API error with raw error message
Sourcepub fn auth_error(description: &str) -> Self
pub fn auth_error(description: &str) -> Self
Create authentication error
Sourcepub fn invalid_parameter(message: &str) -> Self
pub fn invalid_parameter(message: &str) -> Self
Create invalid parameter error
Sourcepub fn file_exists(path: &str) -> Self
pub fn file_exists(path: &str) -> Self
Create file exists error
Sourcepub fn file_not_found(path: &str) -> Self
pub fn file_not_found(path: &str) -> Self
Create file not found error
Sourcepub fn directory_not_found(path: &str) -> Self
pub fn directory_not_found(path: &str) -> Self
Create directory not found error
Sourcepub fn is_auth_error(&self) -> bool
pub fn is_auth_error(&self) -> bool
Check if error is authentication related
Sourcepub fn is_not_found_error(&self) -> bool
pub fn is_not_found_error(&self) -> bool
Check if error indicates not found
Sourcepub fn is_permission_error(&self) -> bool
pub fn is_permission_error(&self) -> bool
Check if error is permission related
Sourcepub fn is_quota_error(&self) -> bool
pub fn is_quota_error(&self) -> bool
Check if error is quota related
Sourcepub fn is_token_expired(&self) -> bool
pub fn is_token_expired(&self) -> bool
Check if error indicates token expired
Trait Implementations§
Source§impl Debug for NetDiskError
impl Debug for NetDiskError
Source§impl Display for NetDiskError
impl Display for NetDiskError
Source§impl Error for NetDiskError
impl Error for NetDiskError
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()