Skip to content

Commit f9987b1

Browse files
fix: friendly 503 error for overloaded Sandbox (#172)
1 parent 029e3a5 commit f9987b1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/utils/api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ export function handleResponse<D, E>(
148148
throw new Error(errorPrefix + ": Bad gateway");
149149
}
150150

151+
if (result.response.status === 503) {
152+
throw new Error(errorPrefix + ": The sandbox is currently overloaded. Please review your logic to reduce the number of concurrent requests or try again in a moment.");
153+
}
154+
151155
if ("error" in result) {
152156
const error = (result.error as { errors: string[] }).errors[0];
153157
throw new Error(errorPrefix + ": " + error);

0 commit comments

Comments
 (0)