Skip to content

Send response on closewitherror on FTContext #228

@danydasilva

Description

@danydasilva

Send response before close the socket, this cause error for me when the timeout is ocurred twice.

closeWithError(err: Error) {
// If this context already has been closed, don't overwrite the reason.
if (this._closingError) {
return
}
this._closingError = err
// Close the sockets but don't fully reset this context to preserve this._closingError.
this._closeSocket(this._socket)
this._closeSocket(this._dataSocket)
// Give the user's task a chance to react, maybe cleanup resources.
this._passToHandler(err)
// The task might not have been rejected by the user after receiving the error.
this._stopTrackingTask()
this.send("QUIT") // Don't wait for an answer
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions