From c7cc2e5fa467be68c6116dd06563528e5dd4154c Mon Sep 17 00:00:00 2001 From: Sabir Hassan Date: Mon, 6 Mar 2023 14:53:42 +0500 Subject: [PATCH] fix: throw error as it is in sas9RequestClient when its an instance of JobExecutionError --- src/request/Sas9RequestClient.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/request/Sas9RequestClient.ts b/src/request/Sas9RequestClient.ts index a9da3c3..3263948 100644 --- a/src/request/Sas9RequestClient.ts +++ b/src/request/Sas9RequestClient.ts @@ -4,6 +4,7 @@ import axiosCookieJarSupport from 'axios-cookiejar-support' import * as tough from 'tough-cookie' import { prefixMessage } from '@sasjs/utils/error' import { RequestClient, throwIfError } from './RequestClient' +import { JobExecutionError } from '../types/errors' /** * Specific request client for SAS9 in Node.js environments. @@ -69,6 +70,8 @@ export class Sas9RequestClient extends RequestClient { return this.parseResponse(response) }) .catch(async (e: any) => { + if (e instanceof JobExecutionError) throw e + return await this.handleError( e, () =>