better error catching
This commit is contained in:
@ -18,7 +18,9 @@ const tryCatchWrapper = (
|
|||||||
return new Promise((resolve, _) => {
|
return new Promise((resolve, _) => {
|
||||||
try {
|
try {
|
||||||
Function(
|
Function(
|
||||||
`"use strict";try{${codeReplace(code)}} catch (e) {console.log(e); _reportError(e);};`
|
`"use strict";try{${codeReplace(
|
||||||
|
code
|
||||||
|
)}} catch (e) {console.log(e); _reportError(e);};`
|
||||||
).call(application.api);
|
).call(application.api);
|
||||||
resolve(true);
|
resolve(true);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -64,7 +66,7 @@ export const tryEvaluate = async (
|
|||||||
const newFunction = new Function(
|
const newFunction = new Function(
|
||||||
`"use strict";try{${codeReplace(
|
`"use strict";try{${codeReplace(
|
||||||
wrappedCode
|
wrappedCode
|
||||||
)}} catch (e) {console.log(e)};`
|
)}} catch (e) {console.log(e); _reportError(e);};`
|
||||||
);
|
);
|
||||||
addFunctionToCache(candidateCode, newFunction);
|
addFunctionToCache(candidateCode, newFunction);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user