Uncaught Exception in node-red-contrib-azure restarts node red

Created an issue on Github repo fornode-red-contrib-azure
# Uncaught Exception RowKey should be a string - forces node red restart #25

node red should survive an uncaught exception in a node !?

Yes, nodes should catch all exceptions, however in the readme for the node it says
" This is sample code only and should not be used in production. This repo is NOT actively being worked on!"
and there does not seem to be any activity on other issues there so whether you can expect anything to happen I don't know.

1 Like

right! but my comment was that node red should "survive" an uncaught exception in a node and not restart due to a bad written node ...

I do not believe so, no, but I will leave it to someone more knowledgeable to explain the reasoning behind that.

If an uncaughtException happens then node-red has no way of knowing what state everything is in and whether it is safe to continue. All we can do is shutdown and allow ourselves to be restarted.

It's worth reading the Node.JS docs on uncaughtException as it helps to explain why we have to take this drastic action: https://nodejs.org/dist/latest-v12.x/docs/api/process.html#process_warning_using_uncaughtexception_correctly

Attempting to resume normally after an uncaught exception can be similar to pulling out the power cord when upgrading a computer. Nine out of ten times, nothing happens. But the tenth time, the system becomes corrupted.

2 Likes

thanks for the replies