Who knows why we can't capture these errors via the more conventional `child.on('error', (err) => { })` listener 🤷
### Before
```
RethrownError: Failed to render Hydrogen to string. In order to reproduce, feed in these arguments into `renderHydrogenToString(...)`:
renderHydrogenToString arguments: { ... }
at renderHydrogenToString (server/hydrogen-render/render-hydrogen-to-string.js:58:11)
--- Original Error ---
RethrownError: Child process exited with code 1
at assembleErrorAfterChildExitsWithErrors (server/child-process-runner/run-in-child-process.js:60:29)
--- Original Error ---
No child errors
```
### After
```
RethrownError: Failed to render Hydrogen to string. In order to reproduce, feed in these arguments into `renderHydrogenToString(...)`:
renderHydrogenToString arguments: { ... }
at renderHydrogenToString (server/hydrogen-render/render-hydrogen-to-string.js:58:11)
--- Original Error ---
RethrownError: Child process exited with code 1
at assembleErrorAfterChildExitsWithErrors (server/child-process-runner/run-in-child-process.js:60:29)
--- Original Error ---
No child errors but there might be something in stderr=node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '../lib/rethrown-error'
Require stack:
- server/child-process-runner/child-fork-script.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (server/child-process-runner/child-fork-script.js:8:23)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'server//child-process-runner//child-fork-script.js'
]
}
```
Follow-up to https://github.com/matrix-org/matrix-public-archive/pull/36
Render pipeline separation of concerns:
1. Run in `child_process`
2. Hydrogen render
It's now just a generic `child_process` runner that runs the Hydrogen render in it. This eliminates the windy path of the 1-4 steps that was only held together by the file names themselves.