Skip to content

Commit cda8c66

Browse files
authored
Merge pull request #1399 from hydephp/general-bugfixes
Use a custom exception message when failing to get image size
2 parents eb1f272 + 135f77e commit cda8c66

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ This serves two purposes:
3030
- Updated dropdown navigation menus to support setting priority in config in https://github.com/hydephp/develop/pull/1387 (fixing https://github.com/hydephp/hyde/issues/229)
3131
- Updated the vendor publish command to support parent Laravel Prompts implementation in https://github.com/hydephp/develop/pull/1388
3232
- Fixed wrong version constant in https://github.com/hydephp/develop/pull/1391
33+
- Fixed improperly formatted exception message in https://github.com/hydephp/develop/pull/1399
3334

3435
### Security
3536
- in case of vulnerabilities.

packages/framework/src/Framework/Features/Blogging/Models/FeaturedImage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ protected function getContentLengthForLocalImage(): int
217217
$storagePath = Hyde::mediaPath($this->source);
218218

219219
if (! file_exists($storagePath)) {
220-
throw new FileNotFoundException(sprintf('Image at %s does not exist', Hyde::pathToRelative($storagePath)));
220+
throw new FileNotFoundException(customMessage: sprintf('Featured image [%s] not found.', Hyde::pathToRelative($storagePath)));
221221
}
222222

223223
return filesize($storagePath);

packages/framework/tests/Unit/FeaturedImageUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function testGetContentLength()
124124
public function testFeaturedImageGetContentLengthWithNoSource()
125125
{
126126
$this->expectException(FileNotFoundException::class);
127-
$this->expectExceptionMessage('Image at _media/foo does not exist');
127+
$this->expectExceptionMessage('Featured image [_media/foo] not found.');
128128

129129
$image = new FeaturedImage('_media/foo', ...$this->defaultArguments());
130130
$this->assertEquals(0, $image->getContentLength());

0 commit comments

Comments
 (0)