mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-16 09:41:17 +10:00
style(downloads): Made all errors type-based
Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
@ -93,9 +93,7 @@ fn recieve_handshake_logic(app: &AppHandle, path: String) -> Result<(), RemoteAc
|
||||
let path_chunks: Vec<&str> = path.split("/").collect();
|
||||
if path_chunks.len() != 3 {
|
||||
app.emit("auth/failed", ()).unwrap();
|
||||
return Err(RemoteAccessError::GenericErrror(
|
||||
"Invalid number of handshake chunks".to_string(),
|
||||
));
|
||||
return Err(RemoteAccessError::InvalidResponse);
|
||||
}
|
||||
|
||||
let base_url = {
|
||||
@ -165,9 +163,7 @@ async fn auth_initiate_wrapper() -> Result<(), RemoteAccessError> {
|
||||
let response = client.post(endpoint.to_string()).json(&body).send().await?;
|
||||
|
||||
if response.status() != 200 {
|
||||
return Err("Failed to create redirect URL. Please try again later."
|
||||
.to_string()
|
||||
.into());
|
||||
return Err(RemoteAccessError::InvalidRedirect);
|
||||
}
|
||||
|
||||
let redir_url = response.text().await?;
|
||||
|
||||
Reference in New Issue
Block a user