{"record":{"id":"2cb23b65814dc20e","repo":"slimphp/Slim","slug":"an-unexpected-error-occurred-while-performing-rout","errorCode":null,"errorMessage":"An unexpected error occurred while performing routing.","messagePattern":"An unexpected error occurred while performing routing\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"Slim/Middleware/RoutingMiddleware.php","lineNumber":84,"sourceCode":"        switch ($routeStatus) {\n            case RoutingResults::FOUND:\n                $routeArguments = $routingResults->getRouteArguments();\n                $routeIdentifier = $routingResults->getRouteIdentifier() ?? '';\n                $route = $this->routeResolver\n                    ->resolveRoute($routeIdentifier)\n                    ->prepare($routeArguments);\n                return $request->withAttribute(RouteContext::ROUTE, $route);\n\n            case RoutingResults::NOT_FOUND:\n                throw new HttpNotFoundException($request);\n\n            case RoutingResults::METHOD_NOT_ALLOWED:\n                $exception = new HttpMethodNotAllowedException($request);\n                $exception->setAllowedMethods($routingResults->getAllowedMethods());\n                throw $exception;\n\n            default:\n                throw new RuntimeException('An unexpected error occurred while performing routing.');\n        }\n    }\n\n    /**\n     * Resolves the route from the given request\n     */\n    protected function resolveRoutingResultsFromRequest(ServerRequestInterface $request): RoutingResults\n    {\n        return $this->routeResolver->computeRoutingResults(\n            $request->getUri()->getPath(),\n            $request->getMethod()\n        );\n    }\n}\n","sourceCodeStart":66,"sourceCodeEnd":99,"githubUrl":"https://github.com/slimphp/Slim/blob/80900fb39cafce3ae53b18a2c4f642a122f03095/Slim/Middleware/RoutingMiddleware.php#L66-L99","documentation":"Error \"An unexpected error occurred while performing routing.\" thrown in slimphp/Slim.","triggerScenarios":"Thrown at Slim/Middleware/RoutingMiddleware.php:84 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"80900fb39cafce3ae53b18a2c4f642a122f03095","analyzedAt":"2026-08-21T01:41:09.580Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}