Initial commit
This commit is contained in:
18
src/Exceptions/DeadSocket.php
Normal file
18
src/Exceptions/DeadSocket.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pdahal\Xmpp\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class DeadSocket extends Exception
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$errorCode = socket_last_error();
|
||||
$errorMsg = socket_strerror($errorCode);
|
||||
|
||||
parent::__construct("Couldn't create socket: [$errorCode] $errorMsg");
|
||||
}
|
||||
}
|
15
src/Exceptions/StreamError.php
Normal file
15
src/Exceptions/StreamError.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pdahal\Xmpp\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class StreamError extends Exception
|
||||
{
|
||||
public function __construct(string $streamErrorType)
|
||||
{
|
||||
parent::__construct("Unrecoverable stream error ({$streamErrorType}), trying to reconnect...");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user