From 22eca50e3fdddb0d10fac43b7c1d85c3067ba112 Mon Sep 17 00:00:00 2001 From: Sabir Hassan Date: Wed, 29 Jun 2022 16:59:03 +0500 Subject: [PATCH] fix: do not throw job execution error if response contains >>weboutBEGIN<< --- src/request/RequestClient.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/request/RequestClient.ts b/src/request/RequestClient.ts index dde7c32..66af02f 100644 --- a/src/request/RequestClient.ts +++ b/src/request/RequestClient.ts @@ -703,7 +703,14 @@ const parseError = (data: string) => { } catch (_) {} try { + // There are some edge cases in which the SAS mp_abort macro + // (https://core.sasjs.io/mp__abort_8sas.html) is unable to + // provide a clean exit. In this case the JSON response will + // be wrapped in >>weboutBEGIN<< and >>weboutEND<< strings. + // Therefore, if the first string exists, we won't throw an + // error just yet (the parser may yet throw one instead) const hasError = + !data?.match(/>>weboutBEGIN<