node-red/node-red-nodegen

There's no error handling

kazuhitoyokoi opened this issue · 0 comments

What are the steps to reproduce?

  1. Prepare JavaScript file of function node which node generator will encounter an error.
> vi samples/lower-case.js (Change "lower-case" to "function")
// name: function
// outputs: 1
msg.payload = msg.payload.toLowerCase();
return msg;
  1. Run node generator command to create node.

What happens?

Node generator shows not only an error message but also a success message.

> node-red-nodegen samples/lower-case.js
'function' is duplicated node name. Use another name.
Success: undefined

What do you expect to happen?

Node generator should show only the error message. To solve the problem it should have appropriate error handling.

Please tell us about your environment:

  • Node-RED version: v0.18.4
  • node.js version: v6.11.3
  • npm version: v3.10.10
  • Platform/OS: Ubuntu 16.04
  • Browser: Google Chrome 63.0.3239.132(Official Build)(64 bit)on Windows 10