mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
Extract error message from detail.error in Hashicorp Vault networking
This commit is contained in:
parent
c231578cc3
commit
f1099a24f7
1 changed files with 5 additions and 2 deletions
|
|
@ -9697,8 +9697,11 @@ export const updateHashicorpVaultConfig = async (
|
|||
});
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json();
|
||||
const raw = deriveErrorMessage(errorData);
|
||||
const errorMessage = typeof raw === "string" ? raw : JSON.stringify(raw);
|
||||
const detail = errorData?.detail;
|
||||
const errorMessage =
|
||||
(typeof detail === "object" && detail?.error) ||
|
||||
(typeof detail === "string" && detail) ||
|
||||
deriveErrorMessage(errorData);
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
const data = await response.json();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue