Comparing version
@@ -98,2 +98,13 @@ "use strict"; | ||
} | ||
if (!response.ok) { | ||
if (response.status === 401) { | ||
const body2 = await response.json(); | ||
throw new SuperfaceError(`${body2.title}. ${body2.detail}`); | ||
} | ||
lastError = new SuperfaceError( | ||
`Failed to fetch tool definitions. HTTP status ${response.status}` | ||
); | ||
await delay(attempt); | ||
continue; | ||
} | ||
let body; | ||
@@ -177,2 +188,13 @@ try { | ||
}); | ||
if (!response.ok) { | ||
if (response.status === 401) { | ||
const body = await response.json(); | ||
throw new SuperfaceError(`${body.title}. ${body.detail}`); | ||
} | ||
lastErrorResult = { | ||
status: "error", | ||
error: `Failed to connect to Superface. HTTP status ${response.status}`, | ||
assistant_hint: "Please try again." | ||
}; | ||
} | ||
const contentType = response.headers.get("content-type"); | ||
@@ -243,2 +265,13 @@ if (contentType && contentType.includes("application/json")) { | ||
}); | ||
if (!response.ok) { | ||
if (response.status === 401) { | ||
const body2 = await response.json(); | ||
throw new SuperfaceError(`${body2.title}. ${body2.detail}`); | ||
} | ||
lastError = new SuperfaceError( | ||
`Failed to fetch configuration link. HTTP status ${response.status}` | ||
); | ||
await delay(attempt); | ||
continue; | ||
} | ||
const body = await response.json(); | ||
@@ -245,0 +278,0 @@ return { |
@@ -100,2 +100,13 @@ "use strict"; | ||
} | ||
if (!response.ok) { | ||
if (response.status === 401) { | ||
const body2 = await response.json(); | ||
throw new SuperfaceError(`${body2.title}. ${body2.detail}`); | ||
} | ||
lastError = new SuperfaceError( | ||
`Failed to fetch tool definitions. HTTP status ${response.status}` | ||
); | ||
await delay(attempt); | ||
continue; | ||
} | ||
let body; | ||
@@ -179,2 +190,13 @@ try { | ||
}); | ||
if (!response.ok) { | ||
if (response.status === 401) { | ||
const body = await response.json(); | ||
throw new SuperfaceError(`${body.title}. ${body.detail}`); | ||
} | ||
lastErrorResult = { | ||
status: "error", | ||
error: `Failed to connect to Superface. HTTP status ${response.status}`, | ||
assistant_hint: "Please try again." | ||
}; | ||
} | ||
const contentType = response.headers.get("content-type"); | ||
@@ -245,2 +267,13 @@ if (contentType && contentType.includes("application/json")) { | ||
}); | ||
if (!response.ok) { | ||
if (response.status === 401) { | ||
const body2 = await response.json(); | ||
throw new SuperfaceError(`${body2.title}. ${body2.detail}`); | ||
} | ||
lastError = new SuperfaceError( | ||
`Failed to fetch configuration link. HTTP status ${response.status}` | ||
); | ||
await delay(attempt); | ||
continue; | ||
} | ||
const body = await response.json(); | ||
@@ -247,0 +280,0 @@ return { |
{ | ||
"name": "superface", | ||
"version": "0.1.0-rc.6", | ||
"version": "0.1.0-rc.7", | ||
"description": "Intelligent Tools for Agentic AI", | ||
@@ -5,0 +5,0 @@ "author": "Superface Team <hello@superface.ai>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
176790
8.39%2047
6.89%