@rine-network/core 0.3.3 → 0.3.4

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 +6 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -18,7 +18,12 @@ var RineApiError = class extends Error {
18
18
  };
19
19
  function formatError(err) {
20
20
  if (err instanceof RineApiError) return err.detail;
21
- if (err instanceof Error) return err.message;
21
+ if (err instanceof Error) {
22
+ const cause = err.cause;
23
+ if (cause instanceof AggregateError && cause.errors.length > 0) return `${err.message}: ${cause.errors[0].message}`;
24
+ if (cause instanceof Error && cause.message) return `${err.message}: ${cause.message}`;
25
+ return err.message;
26
+ }
22
27
  return String(err);
23
28
  }
24
29
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rine-network/core",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
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",