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

fix: throw error as it is in sas9RequestClient when its an instance of JobExecutionError

This commit is contained in:
2023-03-06 14:53:42 +05:00
parent 2210e43880
commit c7cc2e5fa4

View File

@@ -4,6 +4,7 @@ import axiosCookieJarSupport from 'axios-cookiejar-support'
import * as tough from 'tough-cookie' import * as tough from 'tough-cookie'
import { prefixMessage } from '@sasjs/utils/error' import { prefixMessage } from '@sasjs/utils/error'
import { RequestClient, throwIfError } from './RequestClient' import { RequestClient, throwIfError } from './RequestClient'
import { JobExecutionError } from '../types/errors'
/** /**
* Specific request client for SAS9 in Node.js environments. * Specific request client for SAS9 in Node.js environments.
@@ -69,6 +70,8 @@ export class Sas9RequestClient extends RequestClient {
return this.parseResponse<T>(response) return this.parseResponse<T>(response)
}) })
.catch(async (e: any) => { .catch(async (e: any) => {
if (e instanceof JobExecutionError) throw e
return await this.handleError( return await this.handleError(
e, e,
() => () =>