Skip to content

Commit

Permalink
Make Arcade integration's embeds fetch errors public when they are (#620
Browse files Browse the repository at this point in the history
)

* Make arcade integration public fetch errors public

* Add changeset
  • Loading branch information
jpreynat authored Nov 19, 2024
1 parent 4d79488 commit e1b0f6d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/real-toes-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@gitbook/integration-arcade': minor
---

Make Arcade integration's embeds fetch errors public when they are
6 changes: 6 additions & 0 deletions integrations/arcade/src/arcade.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ExposableError } from '@gitbook/runtime';

export interface ArcadeOEmbed {
type: 'rich';
title: string;
Expand All @@ -15,6 +17,10 @@ export async function fetchArcadeOEmbedData(flowId: string): Promise<ArcadeOEmbe
const response = await fetch(url.toString());

if (!response.ok) {
if (response.status < 500) {
throw new ExposableError(response.statusText, response.status);
}

throw new Error(`${response.status} ${response.statusText}`);
}

Expand Down

0 comments on commit e1b0f6d

Please sign in to comment.