File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed
packages/provider-s3/src/lib Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -198,17 +198,22 @@ export class S3BuildCache implements RemoteBuildCache {
198198 } : {
199199 artifactName : string ;
200200 } ) : Promise < Response > {
201- const res = await this . s3 . send (
202- new clientS3 . GetObjectCommand ( {
203- Bucket : this . bucket ,
204- Key : `${ this . directory } /${ artifactName } .zip` ,
205- } ) ,
206- ) ;
207- return new Response ( toWebStream ( res . Body as Readable ) , {
208- headers : {
209- 'content-length' : String ( res . ContentLength ) ,
210- } ,
211- } ) ;
201+ try {
202+ const res = await this . s3 . send (
203+ new clientS3 . GetObjectCommand ( {
204+ Bucket : this . bucket ,
205+ Key : `${ this . directory } /${ artifactName } .zip` ,
206+ } ) ,
207+ ) ;
208+ return new Response ( toWebStream ( res . Body as Readable ) , {
209+ headers : {
210+ 'content-length' : String ( res . ContentLength ) ,
211+ } ,
212+ } ) ;
213+ } catch ( error ) {
214+ ( error as Error ) . message = `Build not found or not accessible to the public` ;
215+ throw error ;
216+ }
212217 }
213218
214219 async delete ( {
You can’t perform that action at this time.
0 commit comments