CMS 2.0
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMqtt\Client\Exceptions;
|
||||
|
||||
/**
|
||||
* Exception to be thrown if an MQTT client error occurs.
|
||||
*
|
||||
* @package PhpMqtt\Client\Exceptions
|
||||
*/
|
||||
class MqttClientException extends \Exception
|
||||
{
|
||||
/**
|
||||
* MqttClientException constructor.
|
||||
*/
|
||||
public function __construct(string $message = '', int $code = 0, ?\Throwable $parentException = null)
|
||||
{
|
||||
if (empty($message)) {
|
||||
parent::__construct(
|
||||
sprintf('[%s] The MQTT client encountered an error.', $code),
|
||||
$code,
|
||||
$parentException
|
||||
);
|
||||
} else {
|
||||
parent::__construct($message, $code, $parentException);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user