{"action":"created","issue":{"url":"https://api.github.com/repos/silexphp/Silex/issues/1129","labels_url":"https://api.github.com/repos/silexphp/Silex/issues/1129/labels{/name}","comments_url":"https://api.github.com/repos/silexphp/Silex/issues/1129/comments","events_url":"https://api.github.com/repos/silexphp/Silex/issues/1129/events","html_url":"https://github.com/silexphp/Silex/issues/1129","id":63698904,"number":1129,"title":"Missing \"_locale\" attribute in 404 error page, when no route was matched","user":{"login":"ZeeCoder","id":3679506,"avatar_url":"https://avatars.githubusercontent.com/u/3679506?v=3","gravatar_id":"","url":"https://api.github.com/users/ZeeCoder","html_url":"https://github.com/ZeeCoder","followers_url":"https://api.github.com/users/ZeeCoder/followers","following_url":"https://api.github.com/users/ZeeCoder/following{/other_user}","gists_url":"https://api.github.com/users/ZeeCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/ZeeCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZeeCoder/subscriptions","organizations_url":"https://api.github.com/users/ZeeCoder/orgs","repos_url":"https://api.github.com/users/ZeeCoder/repos","events_url":"https://api.github.com/users/ZeeCoder/events{/privacy}","received_events_url":"https://api.github.com/users/ZeeCoder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-03-23T11:18:42Z","updated_at":"2015-03-24T11:50:26Z","closed_at":null,"body":"I couldn't find anything on the issue, but basically I set up my error pages which are multilingual.\r\nNow when I throw a NotFound exception manually, everything works fine, but when a route is not matched, like: \"/asd\", or even \"/en/asd\", that throws an error: `An exception has been thrown during the rendering of a template (\"Some mandatory parameters are missing (\"_locale\") to generate a URL for route(...)`\r\n\r\nWhy is there such a difference, and how can I handle it?\r\n\r\n\r\nThanks in advance, and also here is some relevant code I'm using:\r\n\r\n```php\r\n$app->error(function (\\Exception $e, $code) use ($app) {\r\n    if ($app['debug']) {\r\n        return;\r\n    }\r\n\r\n    // Catch all errors and show something useful.\r\n    $templates = array(\r\n        'errors/'.$code.'.html.twig',\r\n        'errors/'.substr($code, 0, 2).'x.html.twig',\r\n        'errors/'.substr($code, 0, 1).'xx.html.twig',\r\n        'errors/default.html.twig',\r\n    );\r\n\r\n    return new Response($app['twig']->resolveTemplate($templates)->render(array(\r\n        'code' => $code,\r\n    )), $code);\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/silexphp/Silex/issues/comments/85463770","html_url":"https://github.com/silexphp/Silex/issues/1129#issuecomment-85463770","issue_url":"https://api.github.com/repos/silexphp/Silex/issues/1129","id":85463770,"user":{"login":"ZeeCoder","id":3679506,"avatar_url":"https://avatars.githubusercontent.com/u/3679506?v=3","gravatar_id":"","url":"https://api.github.com/users/ZeeCoder","html_url":"https://github.com/ZeeCoder","followers_url":"https://api.github.com/users/ZeeCoder/followers","following_url":"https://api.github.com/users/ZeeCoder/following{/other_user}","gists_url":"https://api.github.com/users/ZeeCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/ZeeCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZeeCoder/subscriptions","organizations_url":"https://api.github.com/users/ZeeCoder/orgs","repos_url":"https://api.github.com/users/ZeeCoder/repos","events_url":"https://api.github.com/users/ZeeCoder/events{/privacy}","received_events_url":"https://api.github.com/users/ZeeCoder/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T11:50:26Z","updated_at":"2015-03-24T11:50:26Z","body":">Exactly.\r\n\r\nBut I hope I did get my point across?\r\nAlthough I tracked down the source of this issue, I still cannot be satisfied, since nothing really worked so far.\r\nNot to mention how much of a nightmare this could be for a developer just trying out the framework.\r\nMeeting an issue like this would be an instant deal-breaker when choosing a framework.\r\n\r\nAnyway, I'll search for this exact issue about the routing, I think I'll get better results.\r\nI'll be back with new info asap, and until then: thanks for the comments so far. :+1: "}}