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

fix: throw error from parseWeboutResponse function if unable to find webout response

This commit is contained in:
2021-08-18 16:33:26 +05:00
parent e72195ca5d
commit 3c9f133374
2 changed files with 7 additions and 8 deletions

View File

@@ -1,4 +1,6 @@
export const parseWeboutResponse = (response: string) => {
import { WeboutResponseError } from '../types/errors'
export const parseWeboutResponse = (response: string, url?: string) => {
let sasResponse = ''
if (response.includes('>>weboutBEGIN<<')) {
@@ -7,6 +9,7 @@ export const parseWeboutResponse = (response: string) => {
.split('>>weboutBEGIN<<')[1]
.split('>>weboutEND<<')[0]
} catch (e) {
if (url) throw new WeboutResponseError(url)
sasResponse = ''
console.error(e)
}