Unverified Commit da0cbf68 authored by Ameen Patel's avatar Ameen Patel Committed by GitHub
Browse files

fix(runtime): return 500 on LoRA load/unload errors (#5626)


Signed-off-by: default avatarAmeenP <ameenp360@gmail.com>
Co-authored-by: default avatarBiswa Panda <biswa.panda@gmail.com>
parent b43a131c
......@@ -367,9 +367,18 @@ async fn load_lora_handler(
.await
{
Ok(response) => {
if response.status == "error" {
tracing::error!(
"Failed to load LoRA {}: {}",
request.lora_name,
response.message.as_deref().unwrap_or("Unknown error")
);
(StatusCode::INTERNAL_SERVER_ERROR, Json(response))
} else {
tracing::info!("LoRA loaded successfully: {}", request.lora_name);
(StatusCode::OK, Json(response))
}
}
Err(e) => {
tracing::error!("Failed to load LoRA {}: {}", request.lora_name, e);
(
......@@ -411,9 +420,18 @@ async fn unload_lora_handler(
.await
{
Ok(response) => {
if response.status == "error" {
tracing::error!(
"Failed to unload LoRA {}: {}",
lora_name,
response.message.as_deref().unwrap_or("Unknown error")
);
(StatusCode::INTERNAL_SERVER_ERROR, Json(response))
} else {
tracing::info!("LoRA unloaded successfully: {}", lora_name);
(StatusCode::OK, Json(response))
}
}
Err(e) => {
tracing::error!("Failed to unload LoRA {}: {}", lora_name, e);
(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment