Skip to content

Commit 6ff63f2

Browse files
conico974Nicolas Dorseuil
andauthored
Don't throw on >500 API error (#3500)
Co-authored-by: Nicolas Dorseuil <[email protected]>
1 parent b5ad0ce commit 6ff63f2

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

packages/gitbook/src/lib/data/errors.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,6 @@ export function extractCacheControl(error: GitBookAPIError) {
181181
*/
182182
export function getExposableError(error: Error): DataFetcherErrorData {
183183
if (error instanceof GitBookAPIError) {
184-
if (error.code >= 500) {
185-
throw error;
186-
}
187184
const cache = extractCacheControl(error);
188185

189186
return {
@@ -194,10 +191,6 @@ export function getExposableError(error: Error): DataFetcherErrorData {
194191
}
195192

196193
if (error instanceof DataFetcherError) {
197-
if (error.code >= 500) {
198-
throw error;
199-
}
200-
201194
return {
202195
code: error.code,
203196
message: error.message,

0 commit comments

Comments
 (0)