@milaboratories/pl-drivers 1.2.22 → 1.2.23

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.mjs CHANGED
@@ -835,7 +835,7 @@ class It {
835
835
  const P = await fe(
836
836
  l.uploadUrl,
837
837
  this.prepareUploadOpts(l, a)
838
- ), ne = await (await P.body.blob()).text();
838
+ ), ne = await P.body.text();
839
839
  if (this.logger.info(
840
840
  `uploaded chunk ${r} from ${o} of resource: ${e}, response: '${ne.toString()}', status code: ${P.statusCode}`
841
841
  ), P.statusCode != 200)
@@ -1817,11 +1817,13 @@ class Ie {
1817
1817
  signal: n
1818
1818
  });
1819
1819
  if (400 <= r && r < 500)
1820
- throw new re(
1820
+ throw o.on("error", (i) => {
1821
+ }).destroy(), new re(
1821
1822
  `Http error: statusCode: ${r} url: ${e.toString()}`
1822
1823
  );
1823
1824
  if (r != 200)
1824
- throw Error(
1825
+ throw o.on("error", (i) => {
1826
+ }).destroy(), new Error(
1825
1827
  `Http error: statusCode: ${r} url: ${e.toString()}`
1826
1828
  );
1827
1829
  return {
@@ -3676,7 +3678,9 @@ let Br = class {
3676
3678
  const { content: e, size: t } = await this.clientDownload.downloadBlob(
3677
3679
  this.rInfo
3678
3680
  );
3679
- if (await le(m.dirname(this.path)) || w.mkdir(m.dirname(this.path), { recursive: !0 }), !await le(this.path)) {
3681
+ if (await le(m.dirname(this.path)) || w.mkdir(m.dirname(this.path), { recursive: !0 }), await le(this.path))
3682
+ e.cancel("the file already existed");
3683
+ else {
3680
3684
  const n = ee.toWeb(E.createWriteStream(this.path));
3681
3685
  await e.pipeTo(n);
3682
3686
  }
@@ -3946,7 +3950,7 @@ class Wr {
3946
3950
  this.progress.lastError = String(e);
3947
3951
  }
3948
3952
  setDone(e) {
3949
- this.progress.done = e;
3953
+ this.progress.done = e, e && (this.progress.lastError = void 0);
3950
3954
  }
3951
3955
  async updateStatus() {
3952
3956
  try {