File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -353,6 +353,9 @@ class DeployBuildEffects implements BuildEffects {
353
353
try {
354
354
await this . apiClient . postDeployFile ( this . deployId , sourcePath , outputPath ) ;
355
355
} catch ( error ) {
356
+ if ( isApiError ( error ) && error . details . errors . some ( ( e ) => e . code === "FILE_QUOTA_EXCEEDED" ) ) {
357
+ throw new CliError ( "You have reached the total file size limit." , { cause : error } ) ;
358
+ }
356
359
// 413 is "Payload Too Large", however sometimes Cloudflare returns a
357
360
// custom Cloudflare error, 520. Sometimes we also see 502. Handle them all
358
361
if ( isHttpError ( error ) && ( error . statusCode === 413 || error . statusCode === 503 || error . statusCode === 520 ) ) {
@@ -363,7 +366,14 @@ class DeployBuildEffects implements BuildEffects {
363
366
}
364
367
async writeFile ( outputPath : string , content : Buffer | string ) {
365
368
this . logger . log ( outputPath ) ;
366
- await this . apiClient . postDeployFileContents ( this . deployId , content , outputPath ) ;
369
+ try {
370
+ await this . apiClient . postDeployFileContents ( this . deployId , content , outputPath ) ;
371
+ } catch ( error ) {
372
+ if ( isApiError ( error ) && error . details . errors . some ( ( e ) => e . code === "FILE_QUOTA_EXCEEDED" ) ) {
373
+ throw new CliError ( "You have reached the total file size limit." , { cause : error } ) ;
374
+ }
375
+ throw error ;
376
+ }
367
377
}
368
378
}
369
379
You can’t perform that action at this time.
0 commit comments