@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/bindings/zustand.js +4 -2
- package/dist/bindings/zustand.js.map +2 -2
- package/dist/index.js +4 -2
- package/dist/index.js.map +2 -2
- package/dist/types.d.ts +10 -2
- package/package.json +2 -2
package/dist/bindings/zustand.js
CHANGED
|
@@ -252,8 +252,9 @@ import {
|
|
|
252
252
|
|
|
253
253
|
// src/types.ts
|
|
254
254
|
var ConflictError = class extends Error {
|
|
255
|
-
constructor() {
|
|
255
|
+
constructor(currentHash = "") {
|
|
256
256
|
super("hash_mismatch");
|
|
257
|
+
this.currentHash = currentHash;
|
|
257
258
|
this.name = "ConflictError";
|
|
258
259
|
}
|
|
259
260
|
};
|
|
@@ -797,7 +798,8 @@ var StarfishClient = class {
|
|
|
797
798
|
body
|
|
798
799
|
});
|
|
799
800
|
if (res.status === 409) {
|
|
800
|
-
|
|
801
|
+
const conflict = await res.json().catch(() => null);
|
|
802
|
+
throw new ConflictError(conflict?.currentHash ?? "");
|
|
801
803
|
}
|
|
802
804
|
if (!res.ok) {
|
|
803
805
|
throw new StarfishHttpError(res.status, await res.text());
|