Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/Flare.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,7 @@ public function report(Throwable $throwable, callable $callback = null): ?Report
call_user_func($callback, $report);
}

$this->sendReportToApi($report);

return $report;
return $this->sendReportToApi($report);
}

protected function shouldSendReport(Throwable $throwable): bool
Expand Down Expand Up @@ -240,7 +238,7 @@ public function reportMessage(string $message, string $logLevel, callable $callb
call_user_func($callback, $report);
}

$this->sendReportToApi($report);
return $this->sendReportToApi($report);
}

public function sendTestReport(Throwable $throwable)
Expand All @@ -252,14 +250,17 @@ private function sendReportToApi(Report $report)
{
if ($this->filterReportsCallable) {
if (! call_user_func($this->filterReportsCallable, $report)) {
return;
return null;
}
}

try {
$this->api->report($report);
} catch (Exception $exception) {
return null;
}

return $report;
}

public function reset()
Expand Down