Explode Response to Frames
This commit is contained in:
@ -4,8 +4,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace Nsq\Exception;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
final class AuthenticationRequired extends RuntimeException implements NsqException
|
||||
final class AuthenticationRequired extends NsqException
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('NSQ requires authorization, set ClientConfig::$authSecret before connecting');
|
||||
}
|
||||
}
|
||||
|
15
src/Exception/BadResponse.php
Normal file
15
src/Exception/BadResponse.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Nsq\Exception;
|
||||
|
||||
use Nsq\Protocol\Response;
|
||||
|
||||
final class BadResponse extends NsqException
|
||||
{
|
||||
public function __construct(Response $response)
|
||||
{
|
||||
parent::__construct($response->msg);
|
||||
}
|
||||
}
|
@ -4,10 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace Nsq\Exception;
|
||||
|
||||
use RuntimeException;
|
||||
use Throwable;
|
||||
|
||||
final class ConnectionFail extends RuntimeException implements NsqException
|
||||
final class ConnectionFail extends NsqException
|
||||
{
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
|
@ -4,10 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace Nsq\Exception;
|
||||
|
||||
use Nsq\Message;
|
||||
use RuntimeException;
|
||||
use Nsq\Protocol\Message;
|
||||
|
||||
final class MessageAlreadyFinished extends RuntimeException implements NsqException
|
||||
final class MessageAlreadyFinished extends NsqException
|
||||
{
|
||||
public static function finish(Message $message): self
|
||||
{
|
||||
|
@ -4,8 +4,12 @@ declare(strict_types=1);
|
||||
|
||||
namespace Nsq\Exception;
|
||||
|
||||
use RuntimeException;
|
||||
use Nsq\Protocol\Error;
|
||||
|
||||
final class NsqError extends RuntimeException implements NsqException
|
||||
final class NsqError extends NsqException
|
||||
{
|
||||
public function __construct(Error $error)
|
||||
{
|
||||
parent::__construct($error->rawData);
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace Nsq\Exception;
|
||||
|
||||
use Throwable;
|
||||
use RuntimeException;
|
||||
|
||||
interface NsqException extends Throwable
|
||||
class NsqException extends RuntimeException
|
||||
{
|
||||
}
|
||||
|
9
src/Exception/NullReceived.php
Normal file
9
src/Exception/NullReceived.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Nsq\Exception;
|
||||
|
||||
final class NullReceived extends NsqException
|
||||
{
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Nsq\Exception;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
final class UnexpectedResponse extends RuntimeException implements NsqException
|
||||
{
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public static function null(): self
|
||||
{
|
||||
return new self('Response was expected, but null received.');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user