mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-08 01:18:48 +00:00
[advancedcontentfilter] Fix formatting in src/middlewares and doc/advancedcontentfilter
This commit is contained in:
parent
b02724f867
commit
acce253d8e
2 changed files with 14 additions and 19 deletions
|
@ -5,8 +5,8 @@ $container = $slim->getContainer();
|
|||
// Error handler based off https://stackoverflow.com/a/48135009/757392
|
||||
$container['errorHandler'] = function () {
|
||||
return function(Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, Exception $exception)
|
||||
{
|
||||
$responseCode = 500;
|
||||
{
|
||||
$responseCode = 500;
|
||||
|
||||
if (is_a($exception, 'Friendica\Network\HTTPException')) {
|
||||
$responseCode = $exception->httpcode;
|
||||
|
@ -14,17 +14,17 @@ $container['errorHandler'] = function () {
|
|||
|
||||
$errors['message'] = $exception->getMessage();
|
||||
|
||||
$errors['responseCode'] = $responseCode;
|
||||
$errors['responseCode'] = $responseCode;
|
||||
|
||||
return $response
|
||||
->withStatus($responseCode)
|
||||
->withJson($errors);
|
||||
};
|
||||
return $response
|
||||
->withStatus($responseCode)
|
||||
->withJson($errors);
|
||||
};
|
||||
};
|
||||
|
||||
$container['notFoundHandler'] = function () {
|
||||
return function ()
|
||||
return function ()
|
||||
{
|
||||
throw new \Friendica\Network\HTTPException\NotFoundException(L10n::t('Method not found'));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue