mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
PR-URL: https://github.com/nodejs/node/pull/39403 Reviewed-By: Ruy Adorno <ruyadorno@github.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
37 lines
599 B
JavaScript
37 lines
599 B
JavaScript
|
|
const maxRetry = 3
|
|
|
|
class GitError extends Error {
|
|
shouldRetry () {
|
|
return false
|
|
}
|
|
}
|
|
|
|
class GitConnectionError extends GitError {
|
|
constructor (message) {
|
|
super('A git connection error occurred')
|
|
}
|
|
|
|
shouldRetry (number) {
|
|
return number < maxRetry
|
|
}
|
|
}
|
|
|
|
class GitPathspecError extends GitError {
|
|
constructor (message) {
|
|
super('The git reference could not be found')
|
|
}
|
|
}
|
|
|
|
class GitUnknownError extends GitError {
|
|
constructor (message) {
|
|
super('An unknown git error occurred')
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
GitConnectionError,
|
|
GitPathspecError,
|
|
GitUnknownError
|
|
}
|