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

chore(*): clean up, handle debug responses

This commit is contained in:
Krishna Acondy
2021-02-04 09:42:39 +00:00
parent 8edb00f869
commit 613cc6b9ef
6 changed files with 125 additions and 169 deletions

View File

@@ -2,7 +2,6 @@ import { ServerType } from '@sasjs/utils/types'
import { ErrorResponse } from '..'
import { SASViyaApiClient } from '../SASViyaApiClient'
import { JobExecutionError, LoginRequiredError } from '../types'
import { parseWeboutResponse } from '../utils'
import { BaseJobExecutor } from './JobExecutor'
export class JesJobExecutor extends BaseJobExecutor {
@@ -23,19 +22,7 @@ export class JesJobExecutor extends BaseJobExecutor {
.then((response) => {
this.appendRequest(response, sasJob, config.debug)
let responseJson
try {
if (typeof response!.result === 'string') {
responseJson = JSON.parse(response!.result)
} else {
responseJson = response!.result
}
} catch {
responseJson = JSON.parse(parseWeboutResponse(response!.result))
}
return responseJson
return response.result
})
.catch(async (e: Error) => {
if (e instanceof JobExecutionError) {