Handled error handling to pre-request script execution

This commit is contained in:
Andrew Bastin
2020-07-23 22:51:12 -04:00
parent 7954672ef8
commit b1d3fa3f42

View File

@@ -1,6 +1,7 @@
export default function getEnvironmentVariablesFromScript(script) { export default function getEnvironmentVariablesFromScript(script) {
let _variables = {} let _variables = {}
try {
// the pw object is the proxy by which pre-request scripts can pass variables to the request. // the pw object is the proxy by which pre-request scripts can pass variables to the request.
// for security and control purposes, this is the only way a pre-request script should modify variables. // for security and control purposes, this is the only way a pre-request script should modify variables.
let pw = { let pw = {
@@ -15,6 +16,7 @@ export default function getEnvironmentVariablesFromScript(script) {
// run pre-request script within this function so that it has access to the pw object. // run pre-request script within this function so that it has access to the pw object.
new Function("pw", script)(pw) new Function("pw", script)(pw)
} catch (_e) {}
return _variables return _variables
} }