summaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api/src
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-06-21 11:51:40 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-06-21 11:51:40 -0700
commit256b297886352fd0e732183e00d476bb32bc663e (patch)
tree29b36eacee790e6d2356c61ed25ed6f7250f578e /rust/fatcat-api/src
parentcb63f207258071ade7f300dc63e9ed8cb98a1353 (diff)
downloadfatcat-256b297886352fd0e732183e00d476bb32bc663e.tar.gz
fatcat-256b297886352fd0e732183e00d476bb32bc663e.zip
no more default/mangled HTTP status codes
Diffstat (limited to 'rust/fatcat-api/src')
-rw-r--r--rust/fatcat-api/src/client.rs56
-rw-r--r--rust/fatcat-api/src/models.rs11
-rw-r--r--rust/fatcat-api/src/server.rs56
3 files changed, 62 insertions, 61 deletions
diff --git a/rust/fatcat-api/src/client.rs b/rust/fatcat-api/src/client.rs
index 809fd1d6..b94d6f42 100644
--- a/rust/fatcat-api/src/client.rs
+++ b/rust/fatcat-api/src/client.rs
@@ -197,7 +197,7 @@ impl Api for Client {
Ok(AcceptEditgroupResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -262,7 +262,7 @@ impl Api for Client {
Ok(CreateContainerResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -327,7 +327,7 @@ impl Api for Client {
Ok(CreateContainerBatchResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -392,7 +392,7 @@ impl Api for Client {
Ok(CreateCreatorResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -457,7 +457,7 @@ impl Api for Client {
Ok(CreateCreatorBatchResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -515,7 +515,7 @@ impl Api for Client {
Ok(CreateEditgroupResponse::BadRequest(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -580,7 +580,7 @@ impl Api for Client {
Ok(CreateFileResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -645,7 +645,7 @@ impl Api for Client {
Ok(CreateFileBatchResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -710,7 +710,7 @@ impl Api for Client {
Ok(CreateReleaseResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -775,7 +775,7 @@ impl Api for Client {
Ok(CreateReleaseBatchResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -840,7 +840,7 @@ impl Api for Client {
Ok(CreateWorkResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -905,7 +905,7 @@ impl Api for Client {
Ok(CreateWorkBatchResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -965,7 +965,7 @@ impl Api for Client {
Ok(GetContainerResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -1025,7 +1025,7 @@ impl Api for Client {
Ok(GetCreatorResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -1085,7 +1085,7 @@ impl Api for Client {
Ok(GetCreatorReleasesResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -1145,7 +1145,7 @@ impl Api for Client {
Ok(GetEditgroupResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -1202,7 +1202,7 @@ impl Api for Client {
Ok(GetEditorResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -1259,7 +1259,7 @@ impl Api for Client {
Ok(GetEditorChangelogResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -1319,7 +1319,7 @@ impl Api for Client {
Ok(GetFileResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -1379,7 +1379,7 @@ impl Api for Client {
Ok(GetReleaseResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -1439,7 +1439,7 @@ impl Api for Client {
Ok(GetReleaseFilesResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -1488,7 +1488,7 @@ impl Api for Client {
Ok(GetStatsResponse::Success(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -1548,7 +1548,7 @@ impl Api for Client {
Ok(GetWorkResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -1608,7 +1608,7 @@ impl Api for Client {
Ok(GetWorkReleasesResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -1671,7 +1671,7 @@ impl Api for Client {
Ok(LookupContainerResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -1734,7 +1734,7 @@ impl Api for Client {
Ok(LookupCreatorResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -1797,7 +1797,7 @@ impl Api for Client {
Ok(LookupFileResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
@@ -1860,7 +1860,7 @@ impl Api for Client {
Ok(LookupReleaseResponse::NotFound(body))
}
- 0 => {
+ 500 => {
let mut buf = String::new();
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::ErrorResponse>(&buf)?;
diff --git a/rust/fatcat-api/src/models.rs b/rust/fatcat-api/src/models.rs
index 15247ce6..fd9e8658 100644
--- a/rust/fatcat-api/src/models.rs
+++ b/rust/fatcat-api/src/models.rs
@@ -463,6 +463,7 @@ pub struct ReleaseEntity {
#[serde(skip_serializing_if = "Option::is_none")]
pub contribs: Option<Vec<models::ReleaseContrib>>,
+ /// Two-letter RFC1766/ISO639-1 language code, with extensions
#[serde(rename = "language")]
#[serde(skip_serializing_if = "Option::is_none")]
pub language: Option<String>,
@@ -471,14 +472,14 @@ pub struct ReleaseEntity {
#[serde(skip_serializing_if = "Option::is_none")]
pub publisher: Option<String>,
- #[serde(rename = "issue")]
- #[serde(skip_serializing_if = "Option::is_none")]
- pub issue: Option<String>,
-
#[serde(rename = "pages")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pages: Option<String>,
+ #[serde(rename = "issue")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub issue: Option<String>,
+
#[serde(rename = "volume")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume: Option<String>,
@@ -546,8 +547,8 @@ impl ReleaseEntity {
contribs: None,
language: None,
publisher: None,
- issue: None,
pages: None,
+ issue: None,
volume: None,
isbn13: None,
doi: None,
diff --git a/rust/fatcat-api/src/server.rs b/rust/fatcat-api/src/server.rs
index 7eb73122..faa9e293 100644
--- a/rust/fatcat-api/src/server.rs
+++ b/rust/fatcat-api/src/server.rs
@@ -150,7 +150,7 @@ where
AcceptEditgroupResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::ACCEPT_EDITGROUP_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -254,7 +254,7 @@ where
CreateContainerResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::CREATE_CONTAINER_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -360,7 +360,7 @@ where
CreateContainerBatchResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::CREATE_CONTAINER_BATCH_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -466,7 +466,7 @@ where
CreateCreatorResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::CREATE_CREATOR_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -572,7 +572,7 @@ where
CreateCreatorBatchResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::CREATE_CREATOR_BATCH_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -665,7 +665,7 @@ where
CreateEditgroupResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::CREATE_EDITGROUP_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -771,7 +771,7 @@ where
CreateFileResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::CREATE_FILE_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -877,7 +877,7 @@ where
CreateFileBatchResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::CREATE_FILE_BATCH_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -983,7 +983,7 @@ where
CreateReleaseResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::CREATE_RELEASE_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -1089,7 +1089,7 @@ where
CreateReleaseBatchResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::CREATE_RELEASE_BATCH_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -1195,7 +1195,7 @@ where
CreateWorkResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::CREATE_WORK_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -1301,7 +1301,7 @@ where
CreateWorkBatchResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::CREATE_WORK_BATCH_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -1391,7 +1391,7 @@ where
GetContainerResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::GET_CONTAINER_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -1479,7 +1479,7 @@ where
GetCreatorResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::GET_CREATOR_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -1567,7 +1567,7 @@ where
GetCreatorReleasesResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::GET_CREATOR_RELEASES_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -1655,7 +1655,7 @@ where
GetEditgroupResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::GET_EDITGROUP_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -1733,7 +1733,7 @@ where
GetEditorResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::GET_EDITOR_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -1811,7 +1811,7 @@ where
GetEditorChangelogResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::GET_EDITOR_CHANGELOG_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -1899,7 +1899,7 @@ where
GetFileResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::GET_FILE_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -1987,7 +1987,7 @@ where
GetReleaseResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::GET_RELEASE_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -2075,7 +2075,7 @@ where
GetReleaseFilesResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::GET_RELEASE_FILES_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -2133,7 +2133,7 @@ where
GetStatsResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::GET_STATS_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -2221,7 +2221,7 @@ where
GetWorkResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::GET_WORK_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -2309,7 +2309,7 @@ where
GetWorkReleasesResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::GET_WORK_RELEASES_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -2393,7 +2393,7 @@ where
LookupContainerResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::LOOKUP_CONTAINER_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -2477,7 +2477,7 @@ where
LookupCreatorResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::LOOKUP_CREATOR_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -2561,7 +2561,7 @@ where
LookupFileResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::LOOKUP_FILE_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));
@@ -2645,7 +2645,7 @@ where
LookupReleaseResponse::GenericError(body) => {
let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");
- let mut response = Response::with((status::Status::from_u16(0), body_string));
+ let mut response = Response::with((status::Status::from_u16(500), body_string));
response.headers.set(ContentType(mimetypes::responses::LOOKUP_RELEASE_GENERIC_ERROR.clone()));
context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone())));