mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 23:23:51 +00:00
feat: Add new StoredObjectManager
service.
To read and write onto `StoredObject` document using a common interface.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user