core-3nweb-client-lib 0.30.4 → 0.30.5

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.
@@ -1,6 +1,8 @@
1
- export interface ErrorWithCause extends Error {
1
+ type RuntimeException = web3n.RuntimeException;
2
+ export type ErrorWithCause = (Error & {
2
3
  cause: any;
3
- }
4
- export declare function errWithCause(cause: any, message: string): ErrorWithCause;
5
- export declare function recursiveErrJSONify(err: web3n.RuntimeException): any;
4
+ }) | RuntimeException;
5
+ export declare function errWithCause(cause: any, message: string): ErrorWithCause | RuntimeException;
6
+ export declare function recursiveErrJSONify(err: RuntimeException): any;
6
7
  export declare function stringifyErr(err: any): string;
8
+ export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- Copyright (C) 2016 - 2017, 2020, 2022 3NSoft Inc.
3
+ Copyright (C) 2016 - 2017, 2020, 2022, 2024 3NSoft Inc.
4
4
 
5
5
  This program is free software: you can redistribute it and/or modify it under
6
6
  the terms of the GNU General Public License as published by the Free Software
@@ -18,13 +18,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.errWithCause = errWithCause;
19
19
  exports.recursiveErrJSONify = recursiveErrJSONify;
20
20
  exports.stringifyErr = stringifyErr;
21
+ const runtime_1 = require("./runtime");
21
22
  function errWithCause(cause, message) {
22
- const err = new Error(message);
23
- err.cause = cause;
24
- if (cause.failedCipherVerification) {
25
- err.failedCipherVerification = true;
23
+ if (cause.runtimeException) {
24
+ return (0, runtime_1.makeRuntimeException)('secondary', { message, cause }, {});
25
+ }
26
+ else {
27
+ const err = new Error(message);
28
+ err.cause = cause;
29
+ if (cause.failedCipherVerification) {
30
+ err.failedCipherVerification = true;
31
+ }
32
+ return err;
26
33
  }
27
- return err;
28
34
  }
29
35
  function recursiveErrJSONify(err) {
30
36
  if (!err || (typeof err !== 'object') || Array.isArray(err)) {
@@ -23,6 +23,9 @@ exports.makeSubscribingClient = makeSubscribingClient;
23
23
  const map_of_sets_1 = require("../map-of-sets");
24
24
  const synced_1 = require("../processes/synced");
25
25
  function toTransferrableError(e) {
26
+ if (e.runtimeException) {
27
+ return e;
28
+ }
26
29
  const err = {
27
30
  message: e.message,
28
31
  name: e.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-3nweb-client-lib",
3
- "version": "0.30.4",
3
+ "version": "0.30.5",
4
4
  "description": "3NWeb client core library, embeddable into different environments",
5
5
  "main": "build/lib-index.js",
6
6
  "types": "build/lib-index.d.ts",