consistent promise behavior for upload artifact

This commit is contained in:
Rob Herley
2023-12-05 17:35:46 +00:00
committed by GitHub
parent 8ac8bf1d3d
commit 75a3586061
6 changed files with 53 additions and 63 deletions

View File

@@ -0,0 +1,21 @@
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'
}
}

View File

@@ -4,11 +4,6 @@
* *
*****************************************************************************/
export interface UploadArtifactResponse {
/**
* Denotes if an artifact was successfully uploaded
*/
success: boolean
/**
* Total size of the artifact in bytes. Not provided if no artifact was uploaded
*/