Skip to content

Commit 52b6bee

Browse files
authored
Merge pull request #575 from jared-is-ray/error-handling
add error handing in "clear" command to ignore exceptions about storage locations that do exist
2 parents e2cf4f4 + ac59f68 commit 52b6bee

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Console/ClearCommand.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,17 @@ public function __construct(DebugBar $debugbar)
1919
public function fire()
2020
{
2121
$this->debugbar->boot();
22-
22+
2323
if ($storage = $this->debugbar->getStorage()) {
24-
$storage->clear();
24+
try
25+
{
26+
$storage->clear();
27+
} catch(\InvalidArgumentException $e) {
28+
// hide InvalidArgumentException if storage location does not exist
29+
if(strpos($e->getMessage(), 'does not exist') === false) {
30+
throw $e;
31+
}
32+
}
2533
$this->info('Debugbar Storage cleared!');
2634
} else {
2735
$this->error('No Debugbar Storage found..');

0 commit comments

Comments
 (0)