throw sub process err to main process

This commit is contained in:
boufni95 2025-09-18 18:31:57 +00:00
parent bac0d06402
commit 6623f39115
3 changed files with 6 additions and 1 deletions

View file

@ -16,7 +16,10 @@ export default class NostrSubprocess {
constructor(settings: NostrSettings, utils: Utils, eventCallback: EventCallback) { constructor(settings: NostrSettings, utils: Utils, eventCallback: EventCallback) {
this.utils = utils this.utils = utils
this.childProcess = fork("./build/src/services/nostr/handler") this.childProcess = fork("./build/src/services/nostr/handler")
this.childProcess.on("error", console.error) this.childProcess.on("error", (error) => {
console.error("nostr subprocess error")
throw error
})
this.childProcess.on("message", (message: ChildProcessResponse) => { this.childProcess.on("message", (message: ChildProcessResponse) => {
switch (message.type) { switch (message.type) {
case 'ready': case 'ready':

View file

@ -58,6 +58,7 @@ export class StorageInterface extends EventEmitter {
this.process.on('error', (error: Error) => { this.process.on('error', (error: Error) => {
console.error('Storage processor error:', error); console.error('Storage processor error:', error);
this.isConnected = false; this.isConnected = false;
throw error
}); });
this.process.on('exit', (code: number) => { this.process.on('exit', (code: number) => {

View file

@ -113,6 +113,7 @@ class TlvFilesStorageProcessor {
process.on('error', (error: Error) => { process.on('error', (error: Error) => {
console.error('Error in tlv files storage processor:', error); console.error('Error in tlv files storage processor:', error);
throw error
}); });
this.wrtc = new webRTC(t => { this.wrtc = new webRTC(t => {