@drakkar.software/starfish-client 3.0.0-alpha.48 → 3.0.0-alpha.50

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 CHANGED
@@ -27,8 +27,9 @@ import {
27
27
 
28
28
  // src/types.ts
29
29
  var ConflictError = class extends Error {
30
- constructor() {
30
+ constructor(currentHash = "") {
31
31
  super("hash_mismatch");
32
+ this.currentHash = currentHash;
32
33
  this.name = "ConflictError";
33
34
  }
34
35
  };
@@ -572,7 +573,8 @@ var StarfishClient = class {
572
573
  body
573
574
  });
574
575
  if (res.status === 409) {
575
- throw new ConflictError();
576
+ const conflict = await res.json().catch(() => null);
577
+ throw new ConflictError(conflict?.currentHash ?? "");
576
578
  }
577
579
  if (!res.ok) {
578
580
  throw new StarfishHttpError(res.status, await res.text());