We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35e1471 commit 11e8945Copy full SHA for 11e8945
force-app/main/default/lwc/jsButtonLwc/jsButtonLwc.js
@@ -97,10 +97,16 @@ export default class JsButtonLwc extends LightningElement {
97
new RegExp(REGEX_INSERT_UPSERT, "gi"),
98
"await this.executeDml('$1',$3,'$2');"
99
);
100
- //eslint-disable-next-line
101
- let op = await Function("recordId", `return (async ()=>{${js}})()`).bind(
102
- this
103
- )(this.recordId);
104
- return op;
+
+ try {
+ //eslint-disable-next-line
+ let op = await Function("recordId", `return (async ()=>{${js}})()`).bind(
+ this
105
+ )(this.recordId);
106
+ return op;
107
+ } catch (err) {
108
+ console.error("An error occurred " + err.message);
109
+ alert("Unhandled error in script " + err.message);
110
+ }
111
}
112
0 commit comments