f6bd581f77
Follow-up to https://github.com/matrix-org/matrix-public-archive/pull/51 Better `child_process` error handling for a couple scenarios with the finger pointing at it 👉 Also make sure we handle all of these scenarios: 1. Child process fork script throws an `uncaughtException` or `unhandledRejection` - These are captured and serialized back to the parent and stored in `childErrors` and exposed if we never get a successful rendered HTML response. 2. Child process fails to startup - Render process is rejected in the `child.on('error', ...` callback 3. 👉 Child process times out and is aborted - Render process is rejected in the `child.on('error', ...` callback and any `childErrors` encountered are logged 4. 👉 Child process fork script throws an error in scope of in `process.on('message', async (renderOptions) => {` - Child exits with code 1 and we reject the render process with the error 5. Child process exits with code 1 (error) - Render process is rejected with any `childError` info 6. Child process exits with code 0 (success) but never sends back any HTML - We have a `returnedData` data check and any child errors encountered are logged |
||
---|---|---|
.. | ||
config.js | ||
express-async-handler.js | ||
fetch-endpoint.js | ||
rethrown-error.js | ||
safe-json.js | ||
sanitize-html.js | ||
status-error.js |