forked from Drop-OSS/archived-drop-app
Compare commits
3 Commits
v0.3.4
...
small-fixe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe4f295fcd | ||
|
|
1f809063ef | ||
|
|
f41df6531c |
@@ -38,7 +38,7 @@
|
||||
>
|
||||
<dt>
|
||||
<DisclosureButton
|
||||
class="flex w-full items-center justify-between text-left text-gray-900 dark:text-white"
|
||||
class="flex w-full items-center justify-between text-left text-white"
|
||||
>
|
||||
<span class="text-sm font-semibold font-display">{{
|
||||
nav.name
|
||||
@@ -73,9 +73,9 @@
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<div class="inline-flex items-center gap-x-2">
|
||||
<div class="flex flex-col gap-x-2">
|
||||
<p
|
||||
class="text-sm whitespace-nowrap font-display font-semibold"
|
||||
class="truncate text-sm whitespace-nowrap font-display font-semibold"
|
||||
>
|
||||
{{ item.label }}
|
||||
</p>
|
||||
|
||||
@@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||
pub enum Platform {
|
||||
Windows,
|
||||
Linux,
|
||||
#[allow(non_camel_case_types)]
|
||||
macOS,
|
||||
}
|
||||
|
||||
|
||||
@@ -231,7 +231,8 @@ pub fn download_game_bucket(
|
||||
return Err(ApplicationDownloadError::DownloadError(
|
||||
RemoteAccessError::InvalidResponse(DropServerError {
|
||||
status_code: 400,
|
||||
status_message: format!(
|
||||
status_message: "Server Error".to_owned(),
|
||||
message: format!(
|
||||
"invalid number of Content-Lengths recieved: {i}, {lengths}"
|
||||
),
|
||||
}),
|
||||
@@ -245,7 +246,8 @@ pub fn download_game_bucket(
|
||||
return Err(ApplicationDownloadError::DownloadError(
|
||||
RemoteAccessError::InvalidResponse(DropServerError {
|
||||
status_code: 400,
|
||||
status_message: format!(
|
||||
status_message: "Server Error".to_owned(),
|
||||
message: format!(
|
||||
"for {}, expected {}, got {} ({})",
|
||||
drop.filename, drop.length, raw_length, length
|
||||
),
|
||||
|
||||
@@ -80,7 +80,7 @@ pub async fn fetch_user() -> Result<User, RemoteAccessError> {
|
||||
let err: DropServerError = response.json().await?;
|
||||
warn!("{err:?}");
|
||||
|
||||
if err.status_message == "Nonce expired" {
|
||||
if err.message == "Nonce expired" {
|
||||
return Err(RemoteAccessError::OutOfSync);
|
||||
}
|
||||
|
||||
@@ -117,9 +117,9 @@ pub fn auth_initiate_logic(mode: String) -> Result<String, RemoteAccessError> {
|
||||
|
||||
if response.status() != 200 {
|
||||
let data: DropServerError = response.json()?;
|
||||
error!("could not start handshake: {}", data.status_message);
|
||||
error!("could not start handshake: {:?}", data);
|
||||
|
||||
return Err(RemoteAccessError::HandshakeFailed(data.status_message));
|
||||
return Err(RemoteAccessError::HandshakeFailed(data.message));
|
||||
}
|
||||
|
||||
let response = response.text()?;
|
||||
|
||||
@@ -15,7 +15,7 @@ use serde::Deserialize;
|
||||
pub struct DropServerError {
|
||||
pub status_code: usize,
|
||||
pub status_message: String,
|
||||
// pub message: String,
|
||||
pub message: String,
|
||||
// pub url: String,
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ impl Display for RemoteAccessError {
|
||||
RemoteAccessError::InvalidResponse(error) => write!(
|
||||
f,
|
||||
"server returned an invalid response: {}, {}",
|
||||
error.status_code, error.status_message
|
||||
error.status_code, error.message
|
||||
),
|
||||
RemoteAccessError::UnparseableResponse(error) => {
|
||||
write!(f, "server returned an invalid response: {error}")
|
||||
|
||||
@@ -6,7 +6,7 @@ use games::{
|
||||
library::{FetchGameStruct, FrontendGameOptions, Game, get_current_meta, uninstall_game_logic},
|
||||
state::{GameStatusManager, GameStatusWithTransient},
|
||||
};
|
||||
use log::warn;
|
||||
use log::{info, warn};
|
||||
use process::PROCESS_MANAGER;
|
||||
use remote::{
|
||||
auth::generate_authorization_header,
|
||||
@@ -55,7 +55,8 @@ pub async fn fetch_library_logic(
|
||||
if response.status() != 200 {
|
||||
let err = response.json().await.unwrap_or(DropServerError {
|
||||
status_code: 500,
|
||||
status_message: "Invalid response from server.".to_owned(),
|
||||
status_message: "Server Error".to_owned(),
|
||||
message: "Invalid response from server.".to_owned(),
|
||||
});
|
||||
warn!("{err:?}");
|
||||
return Err(RemoteAccessError::InvalidResponse(err));
|
||||
|
||||
Reference in New Issue
Block a user