try {
const index = new Index({
url: "<UPSTASH_VECTOR_REST_URL>",
token: "<UPSTASH_VECTOR_REST_TOKEN>",
// set a timeout of 1 second
signal: () => AbortSignal.timeout(1000),
});
} catch (error) {
if (error.name === "TimeoutError") {
console.error("Request timed out");
} else {
console.error("An error occurred:", error);
}
}