@gitbook/api 0.20.0 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -5
- package/dist/index.js +2 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -452,18 +452,15 @@ var HttpClient = class {
|
|
|
452
452
|
if (r.ok) {
|
|
453
453
|
r.data = data2;
|
|
454
454
|
} else {
|
|
455
|
-
|
|
455
|
+
throw new Error(`${response.status} ${response.statusText}`);
|
|
456
456
|
}
|
|
457
457
|
return r;
|
|
458
|
-
}).catch((e) => {
|
|
459
|
-
r.error = e;
|
|
460
|
-
return r;
|
|
461
458
|
});
|
|
462
459
|
if (cancelToken) {
|
|
463
460
|
this.abortControllers.delete(cancelToken);
|
|
464
461
|
}
|
|
465
462
|
if (!response.ok)
|
|
466
|
-
throw
|
|
463
|
+
throw new Error(`${response.status} ${response.statusText}`);
|
|
467
464
|
return data;
|
|
468
465
|
});
|
|
469
466
|
};
|
package/dist/index.js
CHANGED
|
@@ -384,18 +384,15 @@ var HttpClient = class {
|
|
|
384
384
|
if (r.ok) {
|
|
385
385
|
r.data = data2;
|
|
386
386
|
} else {
|
|
387
|
-
|
|
387
|
+
throw new Error(`${response.status} ${response.statusText}`);
|
|
388
388
|
}
|
|
389
389
|
return r;
|
|
390
|
-
}).catch((e) => {
|
|
391
|
-
r.error = e;
|
|
392
|
-
return r;
|
|
393
390
|
});
|
|
394
391
|
if (cancelToken) {
|
|
395
392
|
this.abortControllers.delete(cancelToken);
|
|
396
393
|
}
|
|
397
394
|
if (!response.ok)
|
|
398
|
-
throw
|
|
395
|
+
throw new Error(`${response.status} ${response.statusText}`);
|
|
399
396
|
return data;
|
|
400
397
|
});
|
|
401
398
|
};
|