diff --git a/packages/common/nbstore/src/impls/cloud/blob.ts b/packages/common/nbstore/src/impls/cloud/blob.ts index cec0a5c9f6..c317f11161 100644 --- a/packages/common/nbstore/src/impls/cloud/blob.ts +++ b/packages/common/nbstore/src/impls/cloud/blob.ts @@ -116,7 +116,10 @@ export class CloudBlobStorage extends BlobStorageBase { throw new OverSizeError(this.humanReadableBlobSizeLimitCache); } if (userFriendlyError.is('CONTENT_TOO_LARGE')) { - throw new OverSizeError(this.humanReadableBlobSizeLimitCache); + throw new OverSizeError( + null, + 'Upload stopped by network proxy: file size exceeds the set limit.' + ); } throw err; } diff --git a/packages/common/nbstore/src/storage/errors/over-size.ts b/packages/common/nbstore/src/storage/errors/over-size.ts index bbedb1a2dd..abf163b3c9 100644 --- a/packages/common/nbstore/src/storage/errors/over-size.ts +++ b/packages/common/nbstore/src/storage/errors/over-size.ts @@ -1,6 +1,10 @@ export class OverSizeError extends Error { - constructor(limit: string | null) { - const formattedLimit = limit ? `${limit} ` : ''; - super(`File size exceeds the ${formattedLimit}limit.`); + constructor(limit: string | null, message?: string) { + if (message) { + super(message); + } else { + const formattedLimit = limit ? `${limit} ` : ''; + super(`File size exceeds the ${formattedLimit}limit.`); + } } }