mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-06-02 13:05:13 +02:00
Log when beacon fails to send
This commit is contained in:
parent
a2bbb18f79
commit
34b0432ceb
34
app/Bus/Handlers/Events/Beacon/LogBeaconFailedHandler.php
Normal file
34
app/Bus/Handlers/Events/Beacon/LogBeaconFailedHandler.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Events\Beacon;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Beacon\BeaconFailedToSendEvent;
|
||||
|
||||
/**
|
||||
* This is the log beacon failed handler.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class LogBeaconFailedHandler
|
||||
{
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Events\Beacon\BeaconFailedToSendEvent $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(BeaconFailedToSendEvent $event)
|
||||
{
|
||||
logger('Beacon failed.');
|
||||
}
|
||||
}
|
@ -22,7 +22,7 @@ class EventServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected $listen = [
|
||||
'CachetHQ\Cachet\Bus\Events\Beacon\BeaconFailedToSendEvent' => [
|
||||
//
|
||||
'CachetHQ\Cachet\Bus\Handlers\Events\Beacon\LogBeaconFailedHandler',
|
||||
],
|
||||
'CachetHQ\Cachet\Bus\Events\Beacon\BeaconWasSentEvent' => [
|
||||
//
|
||||
|
@ -111,7 +111,6 @@ class Beacon implements BeaconContract
|
||||
'json' => $payload,
|
||||
]);
|
||||
} catch (Exception $e) {
|
||||
// TODO: Log a warning that the beacon could not be sent.
|
||||
event(new BeaconFailedToSendEvent());
|
||||
|
||||
return;
|
||||
|
@ -22,7 +22,7 @@ class BeaconFailedToSendEventTest extends AbstractBeaconEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
|
Loading…
x
Reference in New Issue
Block a user