Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Fix "TypeError: err.code.match is not a function" error #170

Merged
merged 1 commit into from
Jun 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/with-tarball-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function withTarballStream (spec, opts, streamHandler) {
// Retry once if we have a cache, to clear up any weird conditions.
// Don't retry network errors, though -- make-fetch-happen has already
// taken care of making sure we're all set on that front.
if (opts.cache && err.code && !err.code.match(/^E\d{3}$/)) {
if (opts.cache && err.code && !String(err.code).match(/^E\d{3}$/)) {
if (err.code === 'EINTEGRITY' || err.code === 'Z_DATA_ERROR') {
opts.log.warn('tarball', `tarball data for ${spec} (${opts.integrity}) seems to be corrupted. Trying one more time.`)
}
Expand Down