@sasjs/adapter 3.7.4 → 3.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -80,5 +80,5 @@
80
80
  "https": "1.0.0",
81
81
  "tough-cookie": "4.0.0"
82
82
  },
83
- "version": "3.7.4"
83
+ "version": "3.7.7"
84
84
  }
@@ -151,7 +151,7 @@ export class WebJobExecutor extends BaseJobExecutor {
151
151
 
152
152
  /* The NodeFormData object does not set the request header - so, set it */
153
153
  const contentType =
154
- formData instanceof NodeFormData
154
+ formData instanceof NodeFormData && typeof FormData === 'undefined'
155
155
  ? `multipart/form-data; boundary=${formData.getBoundary()}`
156
156
  : undefined
157
157
 
@@ -208,7 +208,7 @@ export class WebJobExecutor extends BaseJobExecutor {
208
208
  }
209
209
 
210
210
  const responseObject = appendExtraResponseAttributes(
211
- { result: jsonResponse },
211
+ { result: jsonResponse, log: parsedSasjsServerLog },
212
212
  extraResponseAttributes
213
213
  )
214
214
  resolve(responseObject)
@@ -635,7 +635,7 @@ const parseError = (data: string) => {
635
635
  if (parts.length > 1) {
636
636
  const storedProcessPath = parts[1].split('<i>')[1].split('</i>')[0]
637
637
  const message = `Stored process not found: ${storedProcessPath}`
638
- return new JobExecutionError(404, message, '')
638
+ return new JobExecutionError(500, message, '')
639
639
  }
640
640
  }
641
641
  } catch (_) {}
@@ -649,7 +649,7 @@ const parseError = (data: string) => {
649
649
  if (parts.length > 1) {
650
650
  const log = parts[1].split('<pre>')[1].split('</pre>')[0]
651
651
  const message = `This request completed with errors.`
652
- return new JobExecutionError(404, message, log)
652
+ return new JobExecutionError(500, message, log)
653
653
  }
654
654
  }
655
655
  } catch (_) {}
@@ -12,6 +12,8 @@ export const getValidJson = (str: string | object): object => {
12
12
 
13
13
  if (typeof str === 'object') return str
14
14
 
15
+ if (str === '') return {}
16
+
15
17
  return JSON.parse(str)
16
18
  } catch (e) {
17
19
  if (e instanceof JsonParseArrayError) throw e