slimphp/Slim · error · RuntimeException

%s could not instantiate a decorated response factory.

Error message

%s could not instantiate a decorated response factory.

What it means

Error "%s could not instantiate a decorated response factory." thrown in slimphp/Slim.

Source

Thrown at Slim/Factory/Psr17/SlimHttpPsr17Factory.php:34

class SlimHttpPsr17Factory extends Psr17Factory
{
    protected static string $responseFactoryClass = 'Slim\Http\Factory\DecoratedResponseFactory';

    /**
     * @throws RuntimeException when the factory could not be instantiated
     */
    public static function createDecoratedResponseFactory(
        ResponseFactoryInterface $responseFactory,
        StreamFactoryInterface $streamFactory
    ): ResponseFactoryInterface {
        if (
            !((
                $decoratedResponseFactory = new static::$responseFactoryClass($responseFactory, $streamFactory)
                ) instanceof ResponseFactoryInterface
            )
        ) {
            throw new RuntimeException(get_called_class() . ' could not instantiate a decorated response factory.');
        }

        return $decoratedResponseFactory;
    }
}

View on GitHub (pinned to 80900fb39c)

When it happens

Trigger: Thrown at Slim/Factory/Psr17/SlimHttpPsr17Factory.php:34 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of slimphp/Slim@80900fb39c (2026-08-21). Data as JSON: /api/errors/10a1764566ecd4a2. Report an issue: GitHub.