mirror of
https://github.com/nodejs/node.git
synced 2025-05-13 07:34:30 +00:00

PR-URL: https://github.com/nodejs/node/pull/42122 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Danielle Adams <adamzdanielle@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
37 lines
600 B
JavaScript
37 lines
600 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,
|
|
}
|