@tinycloud/sdk-core 3.2.0-beta.7 → 3.2.0-beta.8

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.cjs CHANGED
@@ -8026,8 +8026,9 @@ async function loadManifest(url) {
8026
8026
  }
8027
8027
  const res = await fetchFn(url);
8028
8028
  if (!res.ok) {
8029
- throw new ManifestValidationError(
8030
- `failed to fetch manifest from ${url}: HTTP ${res.status}`
8029
+ throw Object.assign(
8030
+ new ManifestValidationError(`failed to fetch manifest from ${url}: HTTP ${res.status}`),
8031
+ { status: res.status }
8031
8032
  );
8032
8033
  }
8033
8034
  const json = await res.json();
@@ -16469,7 +16470,7 @@ async function checkNodeInfo(host, sdkProtocol, fetchFn = globalThis.fetch.bind(
16469
16470
  throw new VersionCheckError(host, err6);
16470
16471
  }
16471
16472
  if (!response.ok) {
16472
- throw new VersionCheckError(host);
16473
+ throw new VersionCheckError(host, await httpResponseError(response, "node info fetch failed"));
16473
16474
  }
16474
16475
  const data = await response.json();
16475
16476
  if (sdkProtocol !== data.protocol) {
@@ -18210,6 +18211,16 @@ var CloudLocationResolutionError = class extends Error {
18210
18211
  super(`Unable to resolve TinyCloud location for ${subject}`);
18211
18212
  this.name = "CloudLocationResolutionError";
18212
18213
  this.attempts = attempts;
18214
+ let failure;
18215
+ for (const attempt of attempts) {
18216
+ if (attempt.error === void 0) continue;
18217
+ if (failure !== void 0) {
18218
+ failure = void 0;
18219
+ break;
18220
+ }
18221
+ failure = attempt.error;
18222
+ }
18223
+ this.cause = failure;
18213
18224
  }
18214
18225
  };
18215
18226
  function locationPayloadForRecord(record2) {
@@ -18711,7 +18722,9 @@ async function verifyOwnerNodeBinding(options2) {
18711
18722
  signal: lookup.signal
18712
18723
  });
18713
18724
  if (!response.ok) {
18714
- throw new LocationRecordValidationError(`target node /info returned HTTP ${response.status}`);
18725
+ const failure = new LocationRecordValidationError(`target node /info returned HTTP ${response.status}`);
18726
+ Object.assign(failure, { status: response.status });
18727
+ throw failure;
18715
18728
  }
18716
18729
  const text2 = await boundedResponseText(response, "target node /info", 16 * 1024);
18717
18730
  let body;