@opentap/runner-client 2.1.3-alpha.1.3 → 2.1.3-alpha.1.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/lib/BaseClient.js +7 -5
- package/package.json +1 -1
package/lib/BaseClient.js
CHANGED
|
@@ -138,8 +138,9 @@ var BaseClient = /** @class */ (function () {
|
|
|
138
138
|
response = jsonCodec.decode(message.data);
|
|
139
139
|
}
|
|
140
140
|
if (_this.isErrorResponse(response)) {
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
var error = ErrorResponse.fromJS(response);
|
|
142
|
+
_this.eventEmitter.emit('errorEvent', error);
|
|
143
|
+
return Promise.reject(error);
|
|
143
144
|
}
|
|
144
145
|
return Promise.resolve(response);
|
|
145
146
|
})
|
|
@@ -274,12 +275,13 @@ var BaseClient = /** @class */ (function () {
|
|
|
274
275
|
* @returns Promise of an object
|
|
275
276
|
*/
|
|
276
277
|
BaseClient.prototype.requestChunked = function (subject, replySubject, payload, options, isFullSubject, rawResponse) {
|
|
277
|
-
var _a;
|
|
278
278
|
return __awaiter(this, void 0, void 0, function () {
|
|
279
279
|
var fileSize;
|
|
280
280
|
var _this = this;
|
|
281
|
-
return __generator(this, function (
|
|
282
|
-
if (
|
|
281
|
+
return __generator(this, function (_a) {
|
|
282
|
+
if (!this.connection)
|
|
283
|
+
return [2 /*return*/, Promise.reject("".concat(subject, ": Connection is down! Please try again!"))];
|
|
284
|
+
if (this.connection.isClosed())
|
|
283
285
|
return [2 /*return*/, Promise.reject("".concat(subject, ": Connection has been closed! Please reconnect!"))];
|
|
284
286
|
fileSize = -1;
|
|
285
287
|
return [2 /*return*/, new Promise(function (resolve, reject) {
|