How to throw the error message in register function?

Hi,
How to throw the error message when error happened in register function?
(I tried to call 'node.error(), I cannot see it on Node-RED editor.)