Introduced common exception superclass
This commit is contained in:
1 parent
f749d4a05e
commit
afafb1ac3d
12 files changed
+48
-28
No files matched your search
@@ -13,6 +13,7 @@ use Nyholm\Psr7\Factory\Psr17Factory;
|
||||
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
|
||||
use GuzzleHttp\Client, GuzzleHttp\HandlerStack, GuzzleHttp\Middleware;
|
||||
use Psr\Http\Message\RequestInterface, Psr\Http\Message\ResponseInterface;
|
||||
use CloudObjects\SDK\Exceptions\SDKException;
|
||||
|
||||
/**
|
||||
* The context of an request for an account.
|
||||
@@ -42,7 +43,7 @@ class AccountContext {
|
||||
*/
|
||||
public function __construct(IRI $aauid, $accessToken, ?DataLoader $dataLoader = null) {
|
||||
if (AAUIDParser::getType($aauid) != AAUIDParser::AAUID_ACCOUNT)
|
||||
throw new \Exception("Not a valid AAUID");
|
||||
throw new SDKException("Not a valid AAUID");
|
||||
|
||||
$this->aauid = $aauid;
|
||||
$this->accessToken = $accessToken;
|
||||
@@ -324,7 +325,7 @@ class AccountContext {
|
||||
*/
|
||||
public function setLogCode($logCode) {
|
||||
if (!$this->request) {
|
||||
throw new \Exception('Not in a request context.');
|
||||
throw new SDKException('Not in a request context.');
|
||||
}
|
||||
$this->logCode = $logCode;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user