is a very crude mechanism for exception handling and may be removed from Node.js in the future. An exception that has bubbled all the way up to the
Process
level means that your application, and Node.js may be in an undefined state, and the only sensible approach would be to restart everything.
The preferred way is to add another layer between your application and the Node.js process which is called the domain.
Домены предоставляют возможность обрабатывать несколько различных операций ввода-вывода как одну группу. Таким образом, если ваше приложение или его часть работает в отдельном домене, вы можете безопасно обрабатывать исключения на уровне домена, прежде чем они достигнут
Process
уровень.
Итог
Ключевой вывод для интервью: какой метод разрешения необработанных исключений в Node.js является предпочтительным?
What is the preferred method of resolving unhandled exceptions in N… · Sobeso