Skip to content

Commit

Permalink
Merge pull request #71 from kernwig/retry-on-epipe
Browse files Browse the repository at this point in the history
Issue #69 - Retry on EPIPE error
  • Loading branch information
jeremydaly authored Mar 30, 2020
2 parents 7909f3f + 5da1ccb commit 67f38e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ module.exports = (params) => {
client.destroy() // destroy connection on timeout
resetClient() // reset the client
reject(err) // reject the promise with the error
} else if (err && (/^PROTOCOL_ENQUEUE_AFTER_/.test(err.code) || err.code === 'PROTOCOL_CONNECTION_LOST')) {
} else if (err && (/^PROTOCOL_ENQUEUE_AFTER_/.test(err.code) || err.code === 'PROTOCOL_CONNECTION_LOST' || err.code === 'EPIPE')) {
resetClient() // reset the client
return resolve(query(...args)) // attempt the query again
} else if (err) {
Expand Down

0 comments on commit 67f38e4

Please sign in to comment.