I have been facing with handling an error in Nodejs app. What I want to do is handle or catch any type of
error and programmatically do something (for example create a bash script which refreshs when error
occurs or other activities).
The problem is if lets say the syntax error happens at the very beginning of my code (for example mistyping
variable value or etc.) then I cant handle it, it is totally impossible to me to handle programmatically when app
crashes. You could see example an an example in the link below
If I could detect the crash inside my code then I would inject some code which runs a bash script which
does any kind of activity I want (like refresh, import from github or etc).
Could you please help me with this issue, thanks!