screepers / screeps-multimeter

The most useful tool on your screeps workbench.
MIT License
89 stars 28 forks source link

Fix error message when watch-client.js is not installed #26

Closed SystemParadox closed 4 years ago

SystemParadox commented 4 years ago

Fix TypeError, remove unnecessary stack trace.

Change this:

*** Cannot watch: TypeError: Cannot read property 'expressions' of undefined                                                          
        at multimeter.api.memory.get.then.val (/home/simon/screeps/node_modules/screeps-multimeter/plugins/watch.js:40:72)            
        at process._tickCallback (internal/process/next_tick.js:68:7)

To this:

*** Watch plugin disabled: watch-client.js is not installed or out of date.

To be honest, the watch plugin should be disabled by default to prevent this message completely. As a policy any plugin that requires additional setup should be opt-in only - it should not be in the default plugins list.

CGamesPlay commented 4 years ago

To be honest, the watch plugin should be disabled by default to prevent this message completely. As a policy any plugin that requires additional setup should be opt-in only - it should not be in the default plugins list.

I think this is a fair policy. I would emphasize that the watch plugin is (in my opinion) one of the biggest value-adds to multimeter (aside from just being a headless console), so, while disabling it by default might be the best choice, emphasizing it and making setup easy should probably be a goal as well.