diff --git a/src/Flare.php b/src/Flare.php index ca623b8..b93b24b 100755 --- a/src/Flare.php +++ b/src/Flare.php @@ -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 @@ -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) @@ -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()