Argument 3 passed to Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException::__construct() must be an instance of Exception or null, array given

Created on 21 January 2021, almost 4 years ago
Updated 24 August 2023, over 1 year ago

Problem/Motivation

The following error has been showing in error logs:

php-error ded-15106 [20-Jan-2021 22:56:13 UTC] TypeError: Argument 3 passed to Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException::__construct() must be an instance of Exception or null, array given, called in REDACTED/fast_404/src/Fast404.php on line 214 in REDACTED/vendor/symfony/http-kernel/Exception/ServiceUnavailableHttpException.php on line 25 #0 REDACTED/fast_404/src/Fast404.php(214): Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException->__construct(3, 'The requested U...', Array)

Proposed resolution

Use the $this->t function for the exception message:

throw new ServiceUnavailableHttpException(3, $this->t('The requested URL "@path" was not found on this server. Try again shortly.', ['@path' => $this->request->getPathInfo()]));

๐Ÿ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States pcate

Live updates comments and jobs are added and updated live.
  • Needs manual testing

    The change/bugfix cannot be fully demonstrated by automated testing, and thus requires manual testing in a variety of environments.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024