You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
599 B
36 lines
599 B
|
|
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
|
|
}
|