mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-15 20:47:15 +01:00
18 lines
441 B
PHP
18 lines
441 B
PHP
<?php
|
|
|
|
namespace Xentral\Carrier\SendCloud;
|
|
|
|
use Exception;
|
|
|
|
class SendcloudApiException extends Exception
|
|
{
|
|
public static function fromResponse(array $response) : SendcloudApiException {
|
|
if (!isset($response['body']) || !is_object($response['body']))
|
|
return new SendcloudApiException(print_r($response,true));
|
|
|
|
return new SendcloudApiException(
|
|
print_r($response['body'],true),
|
|
$response['code']
|
|
);
|
|
}
|
|
} |