Skip to content

Commit 1fcdfc5

Browse files
Copilotna-trium-144
andcommitted
Add HTTP error handling to compileAndRun function
Co-authored-by: na-trium-144 <[email protected]>
1 parent 200d713 commit 1fcdfc5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/terminal/wandbox/api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ export async function compileAndRun(
132132
}
133133
);
134134

135+
if (!response.ok) {
136+
throw new Error(`HTTP error! status: ${response.status}`);
137+
}
138+
135139
// Read the ndjson response line by line
136140
const text = await response.text();
137141
const lines = text.trim().split("\n");

0 commit comments

Comments
 (0)