mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
41 lines
1.0 KiB
PHP
41 lines
1.0 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Chill\DocStoreBundle\Exception;
|
|
|
|
use Exception;
|
|
use Throwable;
|
|
|
|
final class StoredObjectManagerException extends Exception
|
|
{
|
|
public static function errorDuringHttpRequest(Throwable $exception): self
|
|
{
|
|
return new self('Error during HTTP request.', 500, $exception);
|
|
}
|
|
|
|
public static function invalidStatusCode(int $code): self
|
|
{
|
|
return new self(
|
|
sprintf('Invalid status code received (%s).', $code)
|
|
);
|
|
}
|
|
|
|
public static function unableToDecrypt(string $message): self
|
|
{
|
|
return new self(sprintf('Unable to decrypt content (reason: %s).', $message));
|
|
}
|
|
|
|
public static function unableToGetResponseContent(Throwable $exception): self
|
|
{
|
|
return new self('Unable to get content from response.', 500, $exception);
|
|
}
|
|
}
|