You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In production, the app should have a few different avenues to gracefully fail (log, resume/restart)
top-level path: src\index.ts
Describe the Proposed Solution
In the "references" section there are 3 different process.on event listeners/handlers. Consider them from top to bottom ordered like this: 1, 2, 3
uncaughtExceptionMonitor
create custom monitor class here that will handle application recover or restart from unhandled critical failure...
unhandledRejection
implement application logging (just the invocations if Monitor class is robust enough), throwing an error, or other logic
uncaughtException
test where fs.writeSync is outputting to, set up debugger/developer log directory...
References
////////////////////////////////////////////////////////////// #region top-level node critical-failure catch /////process.on('uncaughtExceptionMonitor',(err,origin)=>{console.error(`Critical failure, propagated to top-level from ${origin}, error: `,err);/* TODO: create custom monitor class here that will handle application recover or restart from unhandled critical failure... */});process.on('unhandledRejection',(reason,promise)=>{console.log('Unhandled Rejection at:',promise,'reason:',reason);/* TODO: application logging, throwing an error, or other logic here (bubbled up unhandled promises) */});process.on('uncaughtException',(err,origin)=>{console.error("Critical Error -- app is about to explode... \n performing synchronous cleanup.. \n writing crash state to log file..");fs.writeSync(process.stderr.fd,`Caught exception: ${err}\n`+`Exception origin: ${origin}\n`,);console.error("goodbye.");});/////////////////////////////////////////////////////////// #endregion ///////////////////////////////////////////
The text was updated successfully, but these errors were encountered:
Describe the Problem
In production, the app should have a few different avenues to gracefully fail (log, resume/restart)
top-level path:
src\index.ts
Describe the Proposed Solution
In the "references" section there are 3 different
process.on
event listeners/handlers. Consider them from top to bottom ordered like this: 1, 2, 3uncaughtExceptionMonitor
unhandledRejection
Monitor
class is robust enough), throwing an error, or other logicuncaughtException
fs.writeSync
is outputting to, set up debugger/developer log directory...References
The text was updated successfully, but these errors were encountered: