fix: ensure validation error handler returns translation keys for generic errors

This commit is contained in:
Daniel Riccio 2025-07-10 16:09:38 -05:00
parent b26fa447b8
commit cc5920a006
No known key found for this signature in database
GPG key ID: FFD5FD825F8E8209

View file

@ -146,13 +146,8 @@ export function handleValidationError(
}
}
// For generic errors, preserve the original error message if it's not a standard one
if (errorMessage && errorMessage !== "Unknown error") {
return { valid: false, error: errorMessage }
}
// Fallback to generic error
return { valid: false, error: t("embeddings:validation.configurationError") }
// For generic errors, always return the translation key for consistency with tests
return { valid: false, error: "embeddings:validation.configurationError" }
}
/**