better error handling for web context provider

This commit is contained in:
Nate 2024-10-14 23:00:54 -07:00
parent 99b767d653
commit 8a7d7ce78c

View file

@ -35,7 +35,8 @@ export default class WebContextProvider extends BaseContextProvider {
}),
});
if (!resp.ok) {
throw new Error("Failed to fetch web context");
const text = await resp.text();
throw new Error(`Failed to fetch web context: ${text}`);
}
const json = await resp.json();
return json;