mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
Add vault_addr URL validation, fix error message serialization
This commit is contained in:
parent
7d7e33c5ad
commit
c231578cc3
2 changed files with 8 additions and 1 deletions
|
|
@ -90,11 +90,17 @@ export default function HashicorpVault() {
|
|||
const fieldSchema = properties[fieldName];
|
||||
if (!fieldSchema) return null;
|
||||
|
||||
const rules =
|
||||
fieldName === "vault_addr"
|
||||
? [{ type: "url" as const, message: "Please enter a valid URL" }]
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
<Form.Item
|
||||
key={fieldName}
|
||||
name={fieldName}
|
||||
label={FIELD_LABELS[fieldName] ?? fieldName}
|
||||
rules={rules}
|
||||
>
|
||||
{SENSITIVE_FIELDS.has(fieldName) ? (
|
||||
<Input.Password placeholder={fieldSchema?.description} />
|
||||
|
|
|
|||
|
|
@ -9697,7 +9697,8 @@ export const updateHashicorpVaultConfig = async (
|
|||
});
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json();
|
||||
const errorMessage = deriveErrorMessage(errorData);
|
||||
const raw = deriveErrorMessage(errorData);
|
||||
const errorMessage = typeof raw === "string" ? raw : JSON.stringify(raw);
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
const data = await response.json();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue