You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
50
addons/dysms/sdk/lib/Core/Exception/ClientException.php
Executable file
50
addons/dysms/sdk/lib/Core/Exception/ClientException.php
Executable file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Aliyun\Core\Exception;
|
||||
|
||||
class ClientException extends \Exception
|
||||
{
|
||||
function __construct($errorMessage, $errorCode)
|
||||
{
|
||||
parent::__construct($errorMessage);
|
||||
$this->errorMessage = $errorMessage;
|
||||
$this->errorCode = $errorCode;
|
||||
$this->setErrorType("Client");
|
||||
}
|
||||
|
||||
private $errorCode;
|
||||
private $errorMessage;
|
||||
private $errorType;
|
||||
|
||||
public function getErrorCode()
|
||||
{
|
||||
return $this->errorCode;
|
||||
}
|
||||
|
||||
public function setErrorCode($errorCode)
|
||||
{
|
||||
$this->errorCode = $errorCode;
|
||||
}
|
||||
|
||||
public function getErrorMessage()
|
||||
{
|
||||
return $this->errorMessage;
|
||||
}
|
||||
|
||||
public function setErrorMessage($errorMessage)
|
||||
{
|
||||
$this->errorMessage = $errorMessage;
|
||||
}
|
||||
|
||||
public function getErrorType()
|
||||
{
|
||||
return $this->errorType;
|
||||
}
|
||||
|
||||
public function setErrorType($errorType)
|
||||
{
|
||||
$this->errorType = $errorType;
|
||||
}
|
||||
|
||||
|
||||
}
|
31
addons/dysms/sdk/lib/Core/Exception/ServerException.php
Executable file
31
addons/dysms/sdk/lib/Core/Exception/ServerException.php
Executable file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Aliyun\Core\Exception;
|
||||
|
||||
class ServerException extends ClientException
|
||||
{
|
||||
private $httpStatus;
|
||||
private $requestId;
|
||||
|
||||
function __construct($errorMessage, $errorCode, $httpStatus, $requestId)
|
||||
{
|
||||
$messageStr = $errorCode . " " . $errorMessage . " HTTP Status: " . $httpStatus . " RequestID: " . $requestId;
|
||||
parent::__construct($messageStr, $errorCode);
|
||||
$this->setErrorMessage($errorMessage);
|
||||
$this->setErrorType("Server");
|
||||
$this->httpStatus = $httpStatus;
|
||||
$this->requestId = $requestId;
|
||||
}
|
||||
|
||||
public function getHttpStatus()
|
||||
{
|
||||
return $this->httpStatus;
|
||||
}
|
||||
|
||||
public function getRequestId()
|
||||
{
|
||||
return $this->requestId;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user