From 7122d6db548205c425eeb72c33cec742fd22f3ca Mon Sep 17 00:00:00 2001 From: sychic <47618543+Sychic@users.noreply.github.com> Date: Thu, 17 Sep 2026 17:28:07 -0400 Subject: [PATCH] fix(labrinth): remove unnecessary error wrapping --- apps/labrinth/src/routes/v3/collections.rs | 3 +-- apps/labrinth/src/routes/v3/images.rs | 3 +-- apps/labrinth/src/routes/v3/oauth_clients.rs | 3 +-- apps/labrinth/src/routes/v3/organizations.rs | 3 +-- apps/labrinth/src/routes/v3/projects/mod.rs | 6 ++---- apps/labrinth/src/routes/v3/users.rs | 3 +-- 6 files changed, 7 insertions(+), 14 deletions(-) diff --git a/apps/labrinth/src/routes/v3/collections.rs b/apps/labrinth/src/routes/v3/collections.rs index c2426866eb..1727bd0076 100644 --- a/apps/labrinth/src/routes/v3/collections.rs +++ b/apps/labrinth/src/routes/v3/collections.rs @@ -485,8 +485,7 @@ pub async fn collection_icon_edit( 262144, "Icons must be smaller than 256KiB", ) - .await - .wrap_api_err("executing `read_limited_from_payload`")?; + .await?; let collection_id: CollectionId = collection_item.id.into(); let upload_result = crate::util::img::upload_image_optimized( diff --git a/apps/labrinth/src/routes/v3/images.rs b/apps/labrinth/src/routes/v3/images.rs index 5c6533cd28..4e2c903062 100644 --- a/apps/labrinth/src/routes/v3/images.rs +++ b/apps/labrinth/src/routes/v3/images.rs @@ -204,8 +204,7 @@ pub async fn images_add( 1_048_576, "Icons must be smaller than 1MiB", ) - .await - .wrap_api_err("executing `read_limited_from_payload`")?; + .await?; let content_length = bytes.len(); let upload_result = upload_image_optimized( diff --git a/apps/labrinth/src/routes/v3/oauth_clients.rs b/apps/labrinth/src/routes/v3/oauth_clients.rs index 02c38fcc1b..81a2d5f2f4 100644 --- a/apps/labrinth/src/routes/v3/oauth_clients.rs +++ b/apps/labrinth/src/routes/v3/oauth_clients.rs @@ -473,8 +473,7 @@ pub async fn oauth_client_icon_edit( 262144, "Icons must be smaller than 256KiB", ) - .await - .wrap_api_err("executing `read_limited_from_payload`")?; + .await?; let upload_result = upload_image_optimized( &format!("data/{client_id}"), FileHostPublicity::Public, diff --git a/apps/labrinth/src/routes/v3/organizations.rs b/apps/labrinth/src/routes/v3/organizations.rs index 2b5ddd4662..3e972d254c 100644 --- a/apps/labrinth/src/routes/v3/organizations.rs +++ b/apps/labrinth/src/routes/v3/organizations.rs @@ -1376,8 +1376,7 @@ pub async fn organization_icon_edit( 262144, "Icons must be smaller than 256KiB", ) - .await - .wrap_api_err("executing `read_limited_from_payload`")?; + .await?; let organization_id: OrganizationId = organization_item.id.into(); let upload_result = crate::util::img::upload_image_optimized( diff --git a/apps/labrinth/src/routes/v3/projects/mod.rs b/apps/labrinth/src/routes/v3/projects/mod.rs index 90562ff9b6..8bd7c79890 100644 --- a/apps/labrinth/src/routes/v3/projects/mod.rs +++ b/apps/labrinth/src/routes/v3/projects/mod.rs @@ -2344,8 +2344,7 @@ pub async fn project_icon_edit_internal( 262144, "Icons must be smaller than 256KiB", ) - .await - .wrap_api_err("executing `read_limited_from_payload`")?; + .await?; let project_id: ProjectId = project_item.inner.id.into(); let upload_result = upload_image_optimized( @@ -2657,8 +2656,7 @@ pub async fn add_gallery_item_internal( 5 * (1 << 20), "Gallery image exceeds the maximum of 5MiB.", ) - .await - .wrap_api_err("executing `read_limited_from_payload`")?; + .await?; let id: ProjectId = project_item.inner.id.into(); let upload_result = upload_image_optimized( diff --git a/apps/labrinth/src/routes/v3/users.rs b/apps/labrinth/src/routes/v3/users.rs index 47b9af6dc9..035ed0f7ab 100644 --- a/apps/labrinth/src/routes/v3/users.rs +++ b/apps/labrinth/src/routes/v3/users.rs @@ -1223,8 +1223,7 @@ pub async fn user_icon_edit( 262144, "Icons must be smaller than 256KiB", ) - .await - .wrap_api_err("executing `read_limited_from_payload`")?; + .await?; let user_id: UserId = actual_user.id.into(); let upload_result = crate::util::img::upload_image_optimized(