pinata 2.4.4 → 2.4.6
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.js +19 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2560,7 +2560,7 @@ var uploadFile = async (config, file, network, options) => {
|
|
|
2560
2560
|
}
|
|
2561
2561
|
});
|
|
2562
2562
|
}
|
|
2563
|
-
const chunkSize = 50 * 1024 * 1024;
|
|
2563
|
+
const chunkSize = 50 * 1024 * 1024 + 1;
|
|
2564
2564
|
const totalChunks = Math.ceil(file.size / chunkSize);
|
|
2565
2565
|
let offset = 0;
|
|
2566
2566
|
let uploadReq;
|
|
@@ -2721,10 +2721,16 @@ var uploadFile = async (config, file, network, options) => {
|
|
|
2721
2721
|
throw error;
|
|
2722
2722
|
}
|
|
2723
2723
|
if (error instanceof Error) {
|
|
2724
|
-
throw new PinataError(
|
|
2724
|
+
throw new PinataError(
|
|
2725
|
+
`Error uploading file: ${error.message}`,
|
|
2726
|
+
void 0,
|
|
2727
|
+
{
|
|
2728
|
+
error: error.toString()
|
|
2729
|
+
}
|
|
2730
|
+
);
|
|
2725
2731
|
}
|
|
2726
2732
|
throw new PinataError(
|
|
2727
|
-
"An unknown error occurred while trying to upload
|
|
2733
|
+
"An unknown error occurred while trying to upload file"
|
|
2728
2734
|
);
|
|
2729
2735
|
}
|
|
2730
2736
|
}
|
|
@@ -2793,9 +2799,17 @@ var uploadFile = async (config, file, network, options) => {
|
|
|
2793
2799
|
throw error;
|
|
2794
2800
|
}
|
|
2795
2801
|
if (error instanceof Error) {
|
|
2796
|
-
throw new PinataError(
|
|
2802
|
+
throw new PinataError(
|
|
2803
|
+
`Error uploading file: ${error.message}`,
|
|
2804
|
+
void 0,
|
|
2805
|
+
{
|
|
2806
|
+
error: error.toString()
|
|
2807
|
+
}
|
|
2808
|
+
);
|
|
2797
2809
|
}
|
|
2798
|
-
throw new PinataError(
|
|
2810
|
+
throw new PinataError(
|
|
2811
|
+
"An unknown error occurred while trying to upload file"
|
|
2812
|
+
);
|
|
2799
2813
|
}
|
|
2800
2814
|
};
|
|
2801
2815
|
|