30 lines
1018 B
PHP
30 lines
1018 B
PHP
<?php
|
|
|
|
namespace IriksIT\Manager\Exceptions;
|
|
|
|
use Psr\Http\Message\StreamInterface;
|
|
use RuntimeException;
|
|
|
|
/**
|
|
* The storage behind the media library could not store, return or delete a file.
|
|
* `status` is 404 when the file is gone, 0 otherwise.
|
|
*/
|
|
class MediaStorageException extends RuntimeException
|
|
{
|
|
/**
|
|
* @param StreamInterface|null $placeholder what the API sent instead of the file: a picture, clip, sound or page of the same kind that says what is wrong
|
|
* @param string|null $placeholderType its content type
|
|
* @param string|null $reason the API's name for what is wrong (not-found, unavailable, ...)
|
|
*/
|
|
public function __construct(
|
|
string $message,
|
|
public readonly int $status = 0,
|
|
public readonly ?int $retryAfter = null,
|
|
public readonly ?StreamInterface $placeholder = null,
|
|
public readonly ?string $placeholderType = null,
|
|
public readonly ?string $reason = null,
|
|
) {
|
|
parent::__construct($message);
|
|
}
|
|
}
|