easyeda 0.0.275 → 0.0.276
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/browser/index.js +16 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +17 -3
- package/dist/main.cjs.map +1 -1
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -3441,7 +3441,14 @@ async function fetchEasyEDAComponent(jlcpcbPartNumber, {
|
|
|
3441
3441
|
body: searchData
|
|
3442
3442
|
});
|
|
3443
3443
|
if (!searchResponse.ok) {
|
|
3444
|
-
|
|
3444
|
+
if (searchResponse.status === 403) {
|
|
3445
|
+
throw new Error(
|
|
3446
|
+
`EasyEDA API rate limit exceeded while searching for "${jlcpcbPartNumber}" (HTTP 403). EasyEDA rate-limits by IP \u2014 the part number is likely fine. Wait ~2 minutes and try again.`
|
|
3447
|
+
);
|
|
3448
|
+
}
|
|
3449
|
+
throw new Error(
|
|
3450
|
+
`Failed to search for the component (HTTP ${searchResponse.status})`
|
|
3451
|
+
);
|
|
3445
3452
|
}
|
|
3446
3453
|
const searchResult = await searchResponse.json();
|
|
3447
3454
|
if (!searchResult.success || !searchResult.result.lists.lcsc.length) {
|
|
@@ -3459,7 +3466,14 @@ async function fetchEasyEDAComponent(jlcpcbPartNumber, {
|
|
|
3459
3466
|
}
|
|
3460
3467
|
});
|
|
3461
3468
|
if (!componentResponse.ok) {
|
|
3462
|
-
|
|
3469
|
+
if (componentResponse.status === 403) {
|
|
3470
|
+
throw new Error(
|
|
3471
|
+
`EasyEDA API rate limit exceeded while fetching "${jlcpcbPartNumber}" (HTTP 403). EasyEDA rate-limits by IP \u2014 the part number is likely fine. Wait ~2 minutes and try again.`
|
|
3472
|
+
);
|
|
3473
|
+
}
|
|
3474
|
+
throw new Error(
|
|
3475
|
+
`Failed to fetch the component details (HTTP ${componentResponse.status})`
|
|
3476
|
+
);
|
|
3463
3477
|
}
|
|
3464
3478
|
const componentResult = await componentResponse.json();
|
|
3465
3479
|
const result = componentResult.result;
|
|
@@ -3499,7 +3513,7 @@ var import_promises = __toESM(require("fs/promises"), 1);
|
|
|
3499
3513
|
var package_default = {
|
|
3500
3514
|
name: "easyeda",
|
|
3501
3515
|
type: "module",
|
|
3502
|
-
version: "0.0.
|
|
3516
|
+
version: "0.0.275",
|
|
3503
3517
|
files: [
|
|
3504
3518
|
"dist"
|
|
3505
3519
|
],
|