Skip to content

Commit

Permalink
fix: DatastoreStreamReadable to catch theoretical runNextQuery errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Jul 30, 2024
1 parent 980114e commit 3c48823
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/DatastoreStreamReadable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ export class DatastoreStreamReadable<T = any> extends Readable implements Readab
}

if (!this.running) {
void this.runNextQuery()
void this.runNextQuery().catch(err => {
console.log('error in runNextQuery', err)
this.emit('error', err)
})
} else {
this.logger.log(`_read ${this.count}, wasRunning: true`)
}
Expand Down

0 comments on commit 3c48823

Please sign in to comment.