From 190c2dd1dd43bb97c4c33594270f246a7de061ba Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 17 Mar 2026 22:45:22 -0700 Subject: [PATCH] Include actual limit in file size limit error message Go returns "file over the limited %d bytes" with the actual limit value included. Rust returned a generic "file size limit exceeded" without the limit value, making it harder to debug. --- seaweed-volume/src/server/handlers.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/seaweed-volume/src/server/handlers.rs b/seaweed-volume/src/server/handlers.rs index 57dc7cb50..c54ad8ece 100644 --- a/seaweed-volume/src/server/handlers.rs +++ b/seaweed-volume/src/server/handlers.rs @@ -2048,11 +2048,14 @@ pub async fn post_handler( Some("1" | "t" | "T" | "TRUE" | "True" | "true") ); - // Check file size limit + // Check file size limit (matches Go: "file over the limited %d bytes") if state.file_size_limit_bytes > 0 && body_data_raw.len() as i64 > state.file_size_limit_bytes { return json_error_with_query( StatusCode::BAD_REQUEST, - "file size limit exceeded", + format!( + "file over the limited {} bytes", + state.file_size_limit_bytes + ), Some(&query), ); }