Skip to content

Commit ff19e73

Browse files
Xavier Barbosaxavierbarbosa
authored andcommitted
Better error handling when attempting to retrieve storage files.
1 parent 6cdc8f1 commit ff19e73

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Console/Debug.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Console\Command;
66
use Madewithlove\LaravelDebugConsole\Renderers\RenderersFactory;
7+
use Illuminate\Contracts\Filesystem\FileNotFoundException;
78
use Madewithlove\LaravelDebugConsole\StorageRepository;
89
use React\EventLoop\Factory;
910

@@ -68,7 +69,14 @@ public function handle()
6869
$this->sections = RenderersFactory::create($this->input, $this->output);
6970

7071
$this->loop->addPeriodicTimer(1, function () {
71-
$data = $this->repository->latest();
72+
try {
73+
$data = $this->repository->latest();
74+
} catch (FileNotFoundException $e) {
75+
$this->clear();
76+
$this->error('No laravel debugbar storage files found.');
77+
78+
return;
79+
}
7280

7381
// Checks if its a new request
7482
if (!$this->isNewRequest($data)) {

0 commit comments

Comments
 (0)