1
0
Fork 0
toolkit/packages/artifact/src/internal/shared/errors.ts

38 lines
872 B
TypeScript
Raw Normal View History

export class FilesNotFoundError extends Error {
files: string[]
constructor(files: string[] = []) {
let message = 'No files were found to upload'
if (files.length > 0) {
message += `: ${files.join(', ')}`
}
super(message)
this.files = files
this.name = 'FilesNotFoundError'
}
}
export class InvalidResponseError extends Error {
constructor(message: string) {
super(message)
this.name = 'InvalidResponseError'
}
}
export class ArtifactNotFoundError extends Error {
constructor(message = 'Artifact not found') {
super(message)
this.name = 'ArtifactNotFoundError'
}
}
2023-12-05 18:42:36 +00:00
2023-12-05 18:47:37 +00:00
export class GHESNotSupportedError extends Error {
2023-12-05 18:42:36 +00:00
constructor(
message = '@actions/artifact v2.0.0+ and download-artifact@v4+ are not currently supported on GHES.'
) {
super(message)
2023-12-05 18:47:37 +00:00
this.name = 'GHESNotSupportedError'
2023-12-05 18:42:36 +00:00
}
}