throw only on failure

This commit is contained in:
boufni95 2025-09-26 18:17:41 +00:00
parent eae62c4f4e
commit 9485af1962
3 changed files with 9 additions and 0 deletions

View file

@ -24,6 +24,9 @@ export default class NostrSubprocess {
this.childProcess.on("exit", (code) => { this.childProcess.on("exit", (code) => {
this.log(ERROR, `nostr subprocess exited with code ${code}`) this.log(ERROR, `nostr subprocess exited with code ${code}`)
if (!code) {
return
}
throw new Error(`nostr subprocess exited with code ${code}`) throw new Error(`nostr subprocess exited with code ${code}`)
}) })

View file

@ -64,6 +64,9 @@ export class StorageInterface extends EventEmitter {
this.process.on('exit', (code: number) => { this.process.on('exit', (code: number) => {
this.log(ERROR, `Storage processor exited with code ${code}`); this.log(ERROR, `Storage processor exited with code ${code}`);
this.isConnected = false; this.isConnected = false;
if (!code) {
return
}
throw new Error(`Storage processor exited with code ${code}`) throw new Error(`Storage processor exited with code ${code}`)
}); });

View file

@ -60,6 +60,9 @@ export class TlvStorageFactory extends EventEmitter {
this.process.on('exit', (code: number) => { this.process.on('exit', (code: number) => {
this.log(ERROR, `Tlv Storage processor exited with code ${code}`); this.log(ERROR, `Tlv Storage processor exited with code ${code}`);
this.isConnected = false; this.isConnected = false;
if (!code) {
return
}
throw new Error(`Tlv Storage processor exited with code ${code}`) throw new Error(`Tlv Storage processor exited with code ${code}`)
}); });