mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-27 07:00:29 +01:00
24 lines
539 B
PHP
24 lines
539 B
PHP
<?php
|
|
|
|
/*
|
|
* SPDX-FileCopyrightText: 2022 Andreas Palm
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
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']
|
|
);
|
|
}
|
|
} |