1 2const maxRetry = 3 3 4class GitError extends Error { 5 shouldRetry () { 6 return false 7 } 8} 9 10class GitConnectionError extends GitError { 11 constructor (message) { 12 super('A git connection error occurred') 13 } 14 15 shouldRetry (number) { 16 return number < maxRetry 17 } 18} 19 20class GitPathspecError extends GitError { 21 constructor (message) { 22 super('The git reference could not be found') 23 } 24} 25 26class GitUnknownError extends GitError { 27 constructor (message) { 28 super('An unknown git error occurred') 29 } 30} 31 32module.exports = { 33 GitConnectionError, 34 GitPathspecError, 35 GitUnknownError, 36} 37