@rine-network/core 0.3.1 → 0.3.2

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -945,7 +945,8 @@ async function performRegistration(apiUrl, configDir, profile, params, onProgres
945
945
  if (challengeRes.status === 429) throw new Error("Rate limited — please wait before retrying");
946
946
  if (!challengeRes.ok) {
947
947
  const body = await challengeRes.json().catch(() => ({}));
948
- throw new Error(`Registration failed: ${body.detail ?? challengeRes.statusText}`);
948
+ const detail = typeof body.detail === "string" ? body.detail : body.detail ? JSON.stringify(body.detail) : challengeRes.statusText;
949
+ throw new Error(`Registration failed: ${detail}`);
949
950
  }
950
951
  const challenge = await challengeRes.json();
951
952
  if (challenge.algorithm !== "rsa-timelock-v1") throw new Error(`Unsupported algorithm: ${challenge.algorithm}. Please upgrade.`);
@@ -965,7 +966,8 @@ async function performRegistration(apiUrl, configDir, profile, params, onProgres
965
966
  if (solveRes.status === 410) throw new Error("Challenge expired — please try again");
966
967
  if (!solveRes.ok) {
967
968
  const body = await solveRes.json().catch(() => ({}));
968
- throw new Error(`Solve failed: ${body.detail ?? solveRes.statusText}`);
969
+ const detail = typeof body.detail === "string" ? body.detail : body.detail ? JSON.stringify(body.detail) : solveRes.statusText;
970
+ throw new Error(`Solve failed: ${detail}`);
969
971
  }
970
972
  const data = await solveRes.json();
971
973
  const creds = loadCredentials(configDir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rine-network/core",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Core library for rine.network — crypto, HTTP, config, agent resolution",
5
5
  "author": "mmmbs <mmmbs@proton.me>",
6
6
  "license": "EUPL-1.2",