Skip to content

Commit 892d3db

Browse files
Stop sending FileTooBig exceptions to Sentry
Increase allowed file size
1 parent c34ccfd commit 892d3db

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

app/Console/Commands/RetrieveExtensions.php

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Illuminate\Console\Command;
1515
use Illuminate\Support\Arr;
1616
use Illuminate\Support\Str;
17+
use Spatie\MediaLibrary\MediaCollections\Exceptions\FileIsTooBig;
1718

1819
class RetrieveExtensions extends Command
1920
{
@@ -122,6 +123,10 @@ public function handle()
122123
$exception->getResponse()->getStatusCode() === 404
123124
) {
124125
$this->warn("Not Found error downloading dist file url $distUrl");
126+
} else if ($exception instanceof FileIsTooBig) {
127+
$this->warn("Dist file url $distUrl is too big: " . $exception->getMessage());
128+
129+
logger()->warning("Dist file url $distUrl is too big: " . $exception->getMessage());
125130
} else {
126131
$this->error($exception->getMessage());
127132

config/media-library.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* The maximum file size of an item in bytes.
1313
* Adding a larger file will result in an exception.
1414
*/
15-
'max_file_size' => 1024 * 1024 * 15, // 15MB
15+
'max_file_size' => 1024 * 1024 * 35, // 35MB
1616

1717
/*
1818
* This queue will be used to generate derived and responsive images.

0 commit comments

Comments
 (0)