mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix: Add exceptions.
This commit is contained in:
parent
25fb89f42c
commit
672285d28e
@ -51,10 +51,15 @@ final class ChillWopi implements WopiInterface
|
|||||||
RequestInterface $request
|
RequestInterface $request
|
||||||
): ResponseInterface {
|
): ResponseInterface {
|
||||||
$storedObject = $this->storedObjectRepository->findOneBy(['filename' => $fileId]);
|
$storedObject = $this->storedObjectRepository->findOneBy(['filename' => $fileId]);
|
||||||
|
|
||||||
|
if (null === $storedObject) {
|
||||||
|
throw new Exception(sprintf('Unable to find object named %s', $fileId));
|
||||||
|
}
|
||||||
|
|
||||||
$mimeType = $storedObject->getType();
|
$mimeType = $storedObject->getType();
|
||||||
|
|
||||||
if (false !== current($this->wopiDiscovery->discoverMimeType($mimeType))) {
|
if (false !== current($this->wopiDiscovery->discoverMimeType($mimeType))) {
|
||||||
// TODO Exception.
|
throw new Exception(sprintf('Unable to find mime type %s', $mimeType));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this
|
return $this
|
||||||
|
Loading…
x
Reference in New Issue
Block a user