1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-08 13:00:05 +00:00

fix: log capture if job fails, test framework update, added test for log capture

This commit is contained in:
Mihajlo Medjedovic
2020-08-18 17:36:25 +02:00
parent ea0f338b90
commit fb727788d0
5 changed files with 58 additions and 32 deletions

View File

@@ -579,8 +579,10 @@ export default class SASjs {
resolve(responseJson);
})
.catch(async (e) => {
if (needsRetry(JSON.stringify(e))) {
.catch(async (response) => {
let error = response.error || response;
if (needsRetry(JSON.stringify(error))) {
if (this.retryCountComputeApi < requestRetryLimit) {
let retryResponse = await this.executeJobViaComputeApi(
sasJob,
@@ -599,15 +601,17 @@ export default class SASjs {
}
}
if (e && e.status === 401) {
if (error && error.status === 401) {
if (loginRequiredCallback) loginRequiredCallback(true);
sasjsWaitingRequest.requestPromise.resolve = resolve;
sasjsWaitingRequest.requestPromise.reject = reject;
sasjsWaitingRequest.config = config;
this.sasjsWaitingRequests.push(sasjsWaitingRequest);
} else {
reject({ MESSAGE: e || "Job execution failed" });
reject({ MESSAGE: error || "Job execution failed" });
}
this.appendSasjsRequest(response.log, sasJob, null);
});
}
);