Skip to content

Commit b5b589a

Browse files
authored
fix: detect and handle the ReserveCacheError (#71)
1 parent 44b9e76 commit b5b589a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dist/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2852,7 +2852,7 @@ const saveCachedNpm = npmCache => {
28522852
.catch(err => {
28532853
// don't throw an error if cache already exists, which may happen due to
28542854
// race conditions
2855-
if (err.message.includes('Cache already exists')) {
2855+
if (err instanceof cache.ReserveCacheError) {
28562856
console.warn(err.message)
28572857
return -1
28582858
}

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const saveCachedNpm = npmCache => {
4444
.catch(err => {
4545
// don't throw an error if cache already exists, which may happen due to
4646
// race conditions
47-
if (err.message.includes('Cache already exists')) {
47+
if (err instanceof cache.ReserveCacheError) {
4848
console.warn(err.message)
4949
return -1
5050
}

0 commit comments

Comments
 (0)