Compare commits

...

3 Commits

Author SHA1 Message Date
DecDuck
fe4f295fcd fix: style and capability 2025-12-01 08:42:26 +11:00
DecDuck
1f809063ef fix: fetching versions from server 2025-12-01 08:35:43 +11:00
DecDuck
f41df6531c Fix server error messages 2025-11-30 23:13:01 +11:00
6 changed files with 16 additions and 12 deletions

View File

@@ -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>

View File

@@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
pub enum Platform {
Windows,
Linux,
#[allow(non_camel_case_types)]
macOS,
}

View File

@@ -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
),

View File

@@ -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()?;

View File

@@ -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}")

View File

@@ -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));