Browse Source

Match Go PostHandler: return 500 for all write errors

Go returns 500 (InternalServerError) for all write failures. Rust was
returning 404 for volume-not-found and 403 for read-only volumes.
rust-volume-server
Chris Lu 3 days ago
parent
commit
a6878c8b6b
  1. 6
      seaweed-volume/src/server/handlers.rs

6
seaweed-volume/src/server/handlers.rs

@ -2310,12 +2310,6 @@ pub async fn post_handler(
resp
}
}
Err(crate::storage::volume::VolumeError::NotFound) => {
json_error_with_query(StatusCode::NOT_FOUND, "volume not found", Some(&query))
}
Err(crate::storage::volume::VolumeError::ReadOnly) => {
json_error_with_query(StatusCode::FORBIDDEN, "volume is read-only", Some(&query))
}
Err(e) => {
metrics::HANDLER_COUNTER
.with_label_values(&[metrics::ERROR_WRITE_TO_LOCAL_DISK])

Loading…
Cancel
Save