Skip to content

Commit 09c12fd

Browse files
committed
Fix Dispatch not exists method afterResponse error
1 parent 5918195 commit 09c12fd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Notifier.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,14 @@ public function report(Throwable $exception)
104104
return;
105105
}
106106

107-
dispatch(new SendExceptionNotification(
107+
$dispatch = dispatch(new SendExceptionNotification(
108108
// tap($this->client)->setMessage($this->createMessageByException($exception))
109109
tap($this->client, function (Client $client) use ($exception) {
110110
$client->setMessage($this->createMessageByException($exception));
111111
})
112-
))
113-
->afterResponse();
112+
));
113+
114+
method_exists($dispatch, 'afterResponse') && $dispatch->afterResponse();
114115
} catch (Throwable $e) {
115116
Log::error($e->getMessage());
116117
}

0 commit comments

Comments
 (0)