Reworked File->getUrl to throw exception

In case you require a local URL and one can't be generated, throw
FileNotStoredLocallyException(File $file)
This commit is contained in:
Mikael Nordfeldth
2016-07-07 00:44:50 +02:00
parent 4a3ed7d0ae
commit f02d32b718
2 changed files with 29 additions and 4 deletions

View File

@@ -0,0 +1,15 @@
<?php
if (!defined('GNUSOCIAL')) { exit(1); }
class FileNotStoredLocallyException extends ServerException
{
public $file = null;
public function __construct(File $file)
{
$this->file = $file;
common_debug('Requested local URL for a file that is not stored locally with id=='._ve($this->file->getID()));
parent::__construct(_('Requested local URL for a file that is not stored locally.'));
}
}