File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,25 @@ const (
3030 ArtifactStatusDeleted // 6, ArtifactStatusDeleted is the status of an artifact that is deleted
3131)
3232
33+ func (status ArtifactStatus ) ToString () string {
34+ switch status {
35+ case ArtifactStatusUploadPending :
36+ return "upload is not yet completed"
37+ case ArtifactStatusUploadConfirmed :
38+ return "upload is completed"
39+ case ArtifactStatusUploadError :
40+ return "upload failed"
41+ case ArtifactStatusExpired :
42+ return "expired"
43+ case ArtifactStatusPendingDeletion :
44+ return "pending deletion"
45+ case ArtifactStatusDeleted :
46+ return "deleted"
47+ default :
48+ return "unknown"
49+ }
50+ }
51+
3352func init () {
3453 db .RegisterModel (new (ActionArtifact ))
3554}
Original file line number Diff line number Diff line change @@ -478,7 +478,7 @@ func (ar artifactRoutes) downloadArtifact(ctx *ArtifactContext) {
478478 return
479479 }
480480 if artifact .Status != actions .ArtifactStatusUploadConfirmed {
481- log .Error ("Error artifact not found: unconfirmed" )
481+ log .Error ("Error artifact not found: %s" , artifact . Status . ToString () )
482482 ctx .HTTPError (http .StatusNotFound , "Error artifact not found" )
483483 return
484484 }
Original file line number Diff line number Diff line change @@ -509,7 +509,7 @@ func (r *artifactV4Routes) getSignedArtifactURL(ctx *ArtifactContext) {
509509 return
510510 }
511511 if artifact .Status != actions .ArtifactStatusUploadConfirmed {
512- log .Error ("Error artifact not found: unconfirmed" )
512+ log .Error ("Error artifact not found: %s" , artifact . Status . ToString () )
513513 ctx .HTTPError (http .StatusNotFound , "Error artifact not found" )
514514 return
515515 }
@@ -542,7 +542,7 @@ func (r *artifactV4Routes) downloadArtifact(ctx *ArtifactContext) {
542542 return
543543 }
544544 if artifact .Status != actions .ArtifactStatusUploadConfirmed {
545- log .Error ("Error artifact not found: unconfirmed" )
545+ log .Error ("Error artifact not found: %s" , artifact . Status . ToString () )
546546 ctx .HTTPError (http .StatusNotFound , "Error artifact not found" )
547547 return
548548 }
You can’t perform that action at this time.
0 commit comments