A big disadvantage of the 1.x.x versions of the SVG node was the poor error reporting. Indeed when a user made a mistake, it was very difficult to determine what was going wrong. So got lots of questions since then, and most of the time I had to start my debugger to find the root cause.
And most of the time it was one of the following mistakes:
- An unexisting element id due to typo
- A mix of topics and unrelated commands
- An unexisting command due to typo
Therefore I really wanted to improve the error reporting in the upcoming 2.0 release. So now the "panzoom" branch on Github contains following changes:
A series of validations have been added on the server side. In case of issues an error/warning will be logged in the debug sidepanel (via
node.warn) and the message will be ignored in the dashboard.
Unfortunately lots of errors cannot be validated on the server side. E.g. when a user enters an unexisting element id (or css selector) then we only know that when in doesn't exist when we arrive in the dashboard (i.e. when the element id doesn't exist in the client side DOM tree). And looking at the browser log is very hard, e.g. on smartphones (where you need to setup a remote usb connection...).
To simplify the troubleshooting process, you can now activate this new checkbox:
From now on the errors inside the dashboard will also be displayed on the server side in the debug sidebar:
Remark: when N drawings are visible at the moment (i.e. N dashboards running simultaneously), then N duplicate errors will be displayed (where N can be 0)...
Hope this will assist our users in their drawing experience...
@Steve-Mcl: when the
msg.payload contains an array of objects (each of which has its own command): then I ignore the entire message - in the server side validation - when I find 1 incorrect object (e.g. 1 unexisting command). Is that ok? In the 1.x.x version the client side skipped all correct objects in the array, but it processed the correct objects.
As usual all 'constructive' feedback is more than welcome!