Skip to content

Commit

Permalink
fix: fix typescript errors due to Error
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Aug 25, 2022
1 parent f22fba2 commit a9ccbb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class Socket extends EventEmitter {
}
}
} catch (err) {
if (!this._socket.closed && err.code !== "EBUSY") {
if (!this._socket.closed && (err as {code?: string}).code !== "EBUSY") {
process.nextTick(() => this.emit("error", err))
}
}
Expand All @@ -340,7 +340,7 @@ class Socket extends EventEmitter {
if (cb) cb()
} catch (err) {
if (cb) {
cb(err)
cb(err as Error)
} else {
this.emit("error", err)
}
Expand Down

0 comments on commit a9ccbb2

Please sign in to comment.