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

fix: compute api log not appended to sasjs requests

This commit is contained in:
Mihajlo Medjedovic
2020-11-24 11:59:17 +01:00
parent f1cceeb5e6
commit b6a2a85d1d
2 changed files with 10 additions and 12 deletions

View File

@@ -606,12 +606,10 @@ export class SASViyaApiClient {
throw err
})
return Promise.reject(
new ErrorResponse('Job execution failed.', {
status: 500,
body: log
})
)
return Promise.reject({
status: 500,
log: log
})
}
}
return {

View File

@@ -895,8 +895,8 @@ export default class SASjs {
return responseJson
})
.catch(async (e) => {
if (needsRetry(JSON.stringify(e))) {
.catch(async (response) => {
if (needsRetry(JSON.stringify(response))) {
if (this.retryCountJeseApi < requestRetryLimit) {
let retryResponse = await this.executeJobViaJesApi(
sasJob,
@@ -917,11 +917,11 @@ export default class SASjs {
}
}
if (e?.log) {
this.appendSasjsRequest(e.log, sasJob, null)
if (response?.log) {
this.appendSasjsRequest(response.log, sasJob, null)
}
if (e.toString().includes('Job was not found')) {
if (response.toString().includes('Job was not found')) {
reject(
new ErrorResponse('Service not found on the server.', {
sasJob: sasJob
@@ -929,7 +929,7 @@ export default class SASjs {
)
}
reject(new ErrorResponse('Job execution failed.', e))
reject(new ErrorResponse('Job execution failed.', response))
})
)
}