throw on exit
This commit is contained in:
parent
b1e9dd80a7
commit
eae62c4f4e
3 changed files with 5 additions and 4 deletions
|
|
@ -20,11 +20,11 @@ export default class NostrSubprocess {
|
|||
this.childProcess = fork("./build/src/services/nostr/handler")
|
||||
this.childProcess.on("error", (error) => {
|
||||
this.log(ERROR, "nostr subprocess error", error)
|
||||
throw error
|
||||
})
|
||||
|
||||
this.childProcess.on("exit", (code) => {
|
||||
this.log(ERROR, "nostr subprocess exited with code", `nostr subprocess exited with code ${code}`)
|
||||
this.log(ERROR, `nostr subprocess exited with code ${code}`)
|
||||
throw new Error(`nostr subprocess exited with code ${code}`)
|
||||
})
|
||||
|
||||
this.childProcess.on("message", (message: ChildProcessResponse) => {
|
||||
|
|
|
|||
|
|
@ -59,12 +59,12 @@ export class StorageInterface extends EventEmitter {
|
|||
this.process.on('error', (error: Error) => {
|
||||
this.log(ERROR, 'Storage processor error:', error);
|
||||
this.isConnected = false;
|
||||
throw error
|
||||
});
|
||||
|
||||
this.process.on('exit', (code: number) => {
|
||||
this.log(ERROR, `Storage processor exited with code ${code}`);
|
||||
this.isConnected = false;
|
||||
throw new Error(`Storage processor exited with code ${code}`)
|
||||
});
|
||||
|
||||
this.isConnected = true;
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ export class TlvStorageFactory extends EventEmitter {
|
|||
this.process.on('exit', (code: number) => {
|
||||
this.log(ERROR, `Tlv Storage processor exited with code ${code}`);
|
||||
this.isConnected = false;
|
||||
throw new Error(`Tlv Storage processor exited with code ${code}`)
|
||||
});
|
||||
|
||||
this.isConnected = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue