Skip to content

Commit 17ee3ae

Browse files
committed
Prevent hiding the original exception when unable to record an exception
1 parent 74feab8 commit 17ee3ae

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Handlers/HandleException.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ class HandleException
1212
* Handle an exception.
1313
*/
1414
public function __invoke(Throwable $e): void
15+
{
16+
try {
17+
$this->recordException($e);
18+
} catch (Throwable) {
19+
// TODO: What should we do with the new exception?
20+
}
21+
}
22+
23+
/**
24+
* Record the exception.
25+
*/
26+
protected function recordException(Throwable $e)
1527
{
1628
$keyDate = now()->format('Y-m-d');
1729
$keyExpiry = now()->toImmutable()->startOfDay()->addDays(7)->timestamp;

0 commit comments

Comments
 (0)