mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +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) {
|
||||
const errorData = await response.text();
|
||||
console.error("Error response from the server:", errorData);
|
||||
throw new Error("Network response was not ok");
|
||||
const errorData = await response.json();
|
||||
const errorMsg =
|
||||
errorData.error?.message?.error ||
|
||||
"Network response was not ok";
|
||||
message.error(errorMsg);
|
||||
throw new Error(errorMsg);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue