Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
joedixon committed Dec 22, 2023
1 parent ad54635 commit b1a55a1
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 24 deletions.
11 changes: 2 additions & 9 deletions src/Exceptions/InvalidApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@

namespace Laravel\Reverb\Exceptions;

use Laravel\Reverb\Pusher\Exceptions\PusherException;
use Exception;

class InvalidApplication extends PusherException
class InvalidApplication extends Exception
{
/**
* The error code associated with the exception.
*
* @var int
*/
protected $code = 4001;

/**
* The error message associated with the exception.
*
Expand Down
11 changes: 2 additions & 9 deletions src/Exceptions/InvalidOrigin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@

namespace Laravel\Reverb\Exceptions;

use Laravel\Reverb\Pusher\Exceptions\PusherException;
use Exception;

class InvalidOrigin extends PusherException
class InvalidOrigin extends Exception
{
/**
* The error code associated with the exception.
*
* @var int
*/
protected $code = 4009;

/**
* The error message associated with the exception.
*
Expand Down
22 changes: 22 additions & 0 deletions src/Pusher/Exceptions/InvalidOrigin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Laravel\Reverb\Pusher\Exceptions;

use Laravel\Reverb\Pusher\Exceptions\PusherException;

class InvalidOrigin extends PusherException
{
/**
* The error code associated with the exception.
*
* @var int
*/
protected $code = 4009;

/**
* The error message associated with the exception.
*
* @var string
*/
protected $message = 'Origin not allowed';
}
8 changes: 3 additions & 5 deletions src/Pusher/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@

use Exception;
use Illuminate\Support\Str;
use Laravel\Reverb\Pusher\ClientEvent;
use Laravel\Reverb\Pusher\Contracts\ChannelManager;
use Laravel\Reverb\Contracts\Connection;
use Laravel\Reverb\Contracts\ConnectionManager;
use Laravel\Reverb\Exceptions\InvalidOrigin;
use Laravel\Reverb\Pusher\Exceptions\PusherException;
use Laravel\Reverb\Loggers\Log;
use Laravel\Reverb\Pusher\Contracts\ChannelManager;
use Laravel\Reverb\Pusher\Event as PusherEvent;
use Laravel\Reverb\Pusher\Exceptions\InvalidOrigin;
use Laravel\Reverb\Pusher\Exceptions\PusherException;

class Server
{
Expand Down
2 changes: 1 addition & 1 deletion src/Servers/ApiGateway/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function handle(Request $request): void
} catch (InvalidApplication $e) {
SendToConnection::dispatch(
$request->connectionId(),
$e->message()
$e->getMessage()
);
} catch (\Exception $e) {
$this->server->error(
Expand Down

0 comments on commit b1a55a1

Please sign in to comment.