Use X-REQUEST-ID for Error pages

This commit is contained in:
Philipp 2022-12-26 21:17:32 +01:00
parent 5584e7a4e5
commit 4f1bb0d274
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
55 changed files with 218 additions and 130 deletions

View file

@ -22,13 +22,12 @@
namespace Friendica\Module\HTTPException;
use Friendica\BaseModule;
use Friendica\DI;
use Friendica\Network\HTTPException;
class MethodNotAllowed extends BaseModule
{
protected function content(array $request = []): string
{
throw new HTTPException\MethodNotAllowedException(DI::l10n()->t('Method Not Allowed.'));
throw new HTTPException\MethodNotAllowedException($this->t('Method Not Allowed.'));
}
}

View file

@ -25,8 +25,8 @@ use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Module\Response;
use Friendica\Module\Special\HTTPException as ModuleHTTPException;
use Friendica\Network\HTTPException;
use Friendica\Util\Profiler;
use Psr\Http\Message\ResponseInterface;
@ -46,10 +46,10 @@ class PageNotFound extends BaseModule
protected function content(array $request = []): string
{
throw new HTTPException\NotFoundException(DI::l10n()->t('Page not found.'));
throw new HTTPException\NotFoundException($this->t('Page not found.'));
}
public function run(array $request = []): ResponseInterface
public function run(ModuleHTTPException $httpException, array $request = []): ResponseInterface
{
/* The URL provided does not resolve to a valid module.
*
@ -77,6 +77,6 @@ class PageNotFound extends BaseModule
'query' => $this->server['QUERY_STRING']
]);
return parent::run($request); // TODO: Change the autogenerated stub
return parent::run($httpException, $request);
}
}