How to get errors/exceptions while developing custom node?

I use VSCode (as do the Devs of node-red - I think)

Yes you can debug step your server side code.

For client side, put debugger statements in your code and open dev tools F12.

See this...