Skip to content

Commit

Permalink
fix: detect and handle the ReserveCacheError (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinca authored Dec 10, 2020
1 parent 44b9e76 commit b5b589a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2852,7 +2852,7 @@ const saveCachedNpm = npmCache => {
.catch(err => {
// don't throw an error if cache already exists, which may happen due to
// race conditions
if (err.message.includes('Cache already exists')) {
if (err instanceof cache.ReserveCacheError) {
console.warn(err.message)
return -1
}
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const saveCachedNpm = npmCache => {
.catch(err => {
// don't throw an error if cache already exists, which may happen due to
// race conditions
if (err.message.includes('Cache already exists')) {
if (err instanceof cache.ReserveCacheError) {
console.warn(err.message)
return -1
}
Expand Down

0 comments on commit b5b589a

Please sign in to comment.