mirror of
https://github.com/fluxscape/fluxscape.git
synced 2026-01-12 07:12:54 +01:00
Fix: Javascript node error logs (#14)
In some cases the error is a string, and when logging it will write "undefined" into the console instead of providing a useful error message.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const JavascriptNodeParser = require('../../javascriptnodeparser');
|
||||
const { logJavaScriptNodeError } = require('../../utils');
|
||||
|
||||
const SimpleJavascriptNode = {
|
||||
name: 'JavaScriptFunction',
|
||||
@@ -139,11 +140,8 @@ const SimpleJavascriptNode = {
|
||||
JavascriptNodeParser.getComponentScopeForNode(this)
|
||||
]);
|
||||
} catch (e) {
|
||||
console.log(
|
||||
'Error in JS node run code.',
|
||||
Object.getPrototypeOf(e).constructor.name + ': ' + e.message,
|
||||
e.stack
|
||||
);
|
||||
logJavaScriptNodeError(e);
|
||||
|
||||
if (this.context.editorConnection && this.context.isWarningTypeEnabled('javascriptExecution')) {
|
||||
this.context.editorConnection.sendWarning(
|
||||
this.nodeScope.componentOwner.name,
|
||||
|
||||
Reference in New Issue
Block a user