5 $container = $slim->getContainer();
7 // Error handler based off https://stackoverflow.com/a/48135009/757392
8 $container['errorHandler'] = function () {
9 return function(Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, Exception $exception)
13 if (is_a($exception, 'Friendica\Network\HTTPException')) {
14 $responseCode = $exception->httpcode;
17 $errors['message'] = $exception->getMessage();
19 $errors['responseCode'] = $responseCode;
22 ->withStatus($responseCode)
27 $container['notFoundHandler'] = function () {
30 throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Method not found'));