mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
feat(ui): alert when adding model without STORE_MODEL_IN_DB (#8591)
This commit show user-friendly error using message.error when a model is added via the UI and STORE_MODEL_IN_DB is not True. Fixes: #8516.
This commit is contained in:
parent
5f6f62a34f
commit
0839880f4a
1 changed files with 6 additions and 3 deletions
|
@ -111,9 +111,12 @@ export const modelCreateCall = async (
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
const errorData = await response.text();
|
const errorData = await response.json();
|
||||||
console.error("Error response from the server:", errorData);
|
const errorMsg =
|
||||||
throw new Error("Network response was not ok");
|
errorData.error?.message?.error ||
|
||||||
|
"Network response was not ok";
|
||||||
|
message.error(errorMsg);
|
||||||
|
throw new Error(errorMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue