1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-05 11:40:06 +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 throw err
}) })
return Promise.reject( return Promise.reject({
new ErrorResponse('Job execution failed.', { status: 500,
status: 500, log: log
body: log })
})
)
} }
} }
return { return {

View File

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