Merge pull request #50227 from nextcloud/fix/convert-log

fix: Log exceptions that happen during file conversion
pull/50243/head
Julius Knorr 3 months ago committed by GitHub
commit 6afe12593e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      apps/files/lib/Controller/ConversionApiController.php

@ -24,6 +24,7 @@ use OCP\Files\File;
use OCP\Files\IRootFolder;
use OCP\IL10N;
use OCP\IRequest;
use function OCP\Log\logger;
class ConversionApiController extends OCSController {
public function __construct(
@ -80,7 +81,8 @@ class ConversionApiController extends OCSController {
try {
$convertedFile = $this->fileConversionManager->convert($file, $targetMimeType, $destination);
} catch (\Exception $e) {
throw new OCSException($e->getMessage());
logger('files')->error($e->getMessage(), ['exception' => $e]);
throw new OCSException($this->l10n->t('The file could not be converted.'));
}
$convertedFileRelativePath = $userFolder->getRelativePath($convertedFile);

Loading…
Cancel
Save