Skip to content

Commit 06fbb7c

Browse files
committed
Changelog exception added
1 parent 57e0252 commit 06fbb7c

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/Changelog.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33
namespace BlameButton\Laravel\Changelog;
44

5+
use BlameButton\Laravel\Changelog\Exceptions\ChangelogNotFoundException;
56
use Illuminate\Support\Facades\Storage;
67

78
class Changelog
89
{
9-
// Build your next great package.
10-
1110
private function getFile(): string
1211
{
1312
return config('config.file', base_path('CHANGELOG.md'));
1413
}
1514

16-
public function raw(): ?string
15+
public function raw(): string
1716
{
1817
$file = $this->getFile();
18+
1919
if (!Storage::exists($file)) {
20-
return null;
20+
throw new ChangelogNotFoundException();
2121
}
2222

2323
return Storage::get($file);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace BlameButton\Laravel\Changelog\Exceptions;
4+
5+
use RuntimeException;
6+
7+
class ChangelogNotFoundException extends RuntimeException
8+
{
9+
10+
}

0 commit comments

Comments
 (0)