2024-02-09 00:38:41 +00:00
|
|
|
|
|
|
|
const maxRetry = 3
|
|
|
|
|
|
|
|
class GitError extends Error {
|
|
|
|
shouldRetry () {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class GitConnectionError extends GitError {
|
2024-06-03 19:44:25 +00:00
|
|
|
constructor () {
|
2024-02-09 00:38:41 +00:00
|
|
|
super('A git connection error occurred')
|
|
|
|
}
|
|
|
|
|
|
|
|
shouldRetry (number) {
|
|
|
|
return number < maxRetry
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class GitPathspecError extends GitError {
|
2024-06-03 19:44:25 +00:00
|
|
|
constructor () {
|
2024-02-09 00:38:41 +00:00
|
|
|
super('The git reference could not be found')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class GitUnknownError extends GitError {
|
2024-06-03 19:44:25 +00:00
|
|
|
constructor () {
|
2024-02-09 00:38:41 +00:00
|
|
|
super('An unknown git error occurred')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
GitConnectionError,
|
|
|
|
GitPathspecError,
|
|
|
|
GitUnknownError,
|
|
|
|
}
|