@lad-tech/nsc-toolkit 1.15.4 → 1.15.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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
- ## [1.15.4](https://github.com/lad-tech/nsc-toolkit/compare/v1.15.3...v1.15.4) (2023-08-17)
1
+ ## [1.15.5](https://github.com/lad-tech/nsc-toolkit/compare/v1.15.4...v1.15.5) (2023-09-08)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * Fix inject Constant in property ([#79](https://github.com/lad-tech/nsc-toolkit/issues/79)) ([8445fee](https://github.com/lad-tech/nsc-toolkit/commit/8445feeb3d81b4e85c933600794c29f3018598de))
6
+ * add nats error code to error message ([#83](https://github.com/lad-tech/nsc-toolkit/issues/83)) ([a043b5c](https://github.com/lad-tech/nsc-toolkit/commit/a043b5cbd0b71a513d8a6db4cc4305dd4d9182c6))
package/dist/Client.js CHANGED
@@ -110,7 +110,7 @@ class Client extends Root_1.Root {
110
110
  }
111
111
  }
112
112
  async request(subject, data, { options, request, response }) {
113
- var _a, _b, _c;
113
+ var _a, _b, _c, _d;
114
114
  const tracer = opentelemetry.trace.getTracer('');
115
115
  const span = tracer.startSpan(subject, undefined, this.getContext(this.baggage));
116
116
  try {
@@ -141,9 +141,9 @@ class Client extends Root_1.Root {
141
141
  ? await this.makeHttpRequest(subject, message, options, timeout)
142
142
  : await this.makeBrokerRequest(subject, message, timeout);
143
143
  if (result.error) {
144
- throw new Error(result.error.message);
144
+ throw new Error((_c = result.error.message) !== null && _c !== void 0 ? _c : result.error);
145
145
  }
146
- if (((_c = options === null || options === void 0 ? void 0 : options.runTimeValidation) === null || _c === void 0 ? void 0 : _c.response) && response) {
146
+ if (((_d = options === null || options === void 0 ? void 0 : options.runTimeValidation) === null || _d === void 0 ? void 0 : _d.response) && response) {
147
147
  this.validate(result.payload, response);
148
148
  }
149
149
  if ((options === null || options === void 0 ? void 0 : options.cache) && !this.isStream(result.payload) && this.cache) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lad-tech/nsc-toolkit",
3
- "version": "1.15.4",
3
+ "version": "1.15.5",
4
4
  "description": "Toolkit for create microservices around NATS",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/types/index.d.ts",