mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-08-26 12:24:44 -04:00
fix: enhance error message in llamacloud (#1672)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
fix: enhance error message in llamacloud
|
||||
@@ -31,6 +31,11 @@ export function initService({ apiKey, baseUrl }: ClientParams = {}) {
|
||||
request.headers.set("Authorization", `Bearer ${token}`);
|
||||
return request;
|
||||
});
|
||||
client.interceptors.error.use((error) => {
|
||||
throw new Error(
|
||||
`LlamaCloud API request failed. Error details: ${JSON.stringify(error)}`,
|
||||
);
|
||||
});
|
||||
if (!token) {
|
||||
throw new Error(
|
||||
"API Key is required for LlamaCloudIndex. Please pass the apiKey parameter",
|
||||
|
||||
Reference in New Issue
Block a user