Skip to content

How/where to handle ESOCKET/ECONNRESET error #568

Description

@MatejSkrbis

I tried to listen for error event, but as I saw in source code (tedious.js), ESOCKET event is ignored and nothing is emitted. I could see ECONNRESET in debug however. So how can I handle this event correctly? Occasionally this error occurs and then all requests are time-outed.

tedious.js

tedious.on('error', err => {
  if (err.code === 'ESOCKET') {
    tedious.hasError = true
    return
  }

  this.emit('error', err)
})

if (this.config.debug) {
  tedious.on('debug', this.emit.bind(this, 'debug', tedious))
}

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions