@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 +2 -2
- package/dist/Client.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
## [1.15.
|
|
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
|
-
*
|
|
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 (((
|
|
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) {
|