Skip to content

Commit fe95500

Browse files
committed
Return a more specific http status code on conflict.
1 parent a32ad4b commit fe95500

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

common/src/api/external/error.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,9 @@ impl From<Error> for HttpError {
420420

421421
Error::ObjectAlreadyExists { type_name: t, object_name: n } => {
422422
let message = format!("already exists: {} \"{}\"", t, n);
423-
HttpError::for_bad_request(
423+
HttpError::for_client_error(
424424
Some(String::from("ObjectAlreadyExists")),
425+
dropshot::ClientErrorStatusCode::CONFLICT,
425426
message,
426427
)
427428
}

0 commit comments

Comments
 (0)