Improved http error handling

This commit is contained in:
Michael 2021-10-29 23:21:07 +00:00
parent b2165cdf22
commit 4236a9a105
55 changed files with 282 additions and 135 deletions

View file

@ -32,8 +32,7 @@ use Friendica\DI;
use Friendica\Factory\ConfigFactory;
use Friendica\Model\Register;
use Friendica\Module\BaseAdmin;
use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Util\ConfigFileLoader;
use Friendica\Network\HTTPException\ServiceUnavailableException;
use Friendica\Util\DateTimeFormat;
class Summary extends BaseAdmin
@ -129,7 +128,7 @@ class Summary extends BaseAdmin
$stream = $fileSystem->createStream($file);
if (!isset($stream)) {
throw new InternalServerErrorException('Stream is null.');
throw new ServiceUnavailableException('Stream is null.');
}
} catch (\Throwable $exception) {
@ -143,7 +142,7 @@ class Summary extends BaseAdmin
$stream = $fileSystem->createStream($file);
if (!isset($stream)) {
throw new InternalServerErrorException('Stream is null.');
throw new ServiceUnavailableException('Stream is null.');
}
}
} catch (\Throwable $exception) {