{"record":{"id":"07a2b20d2da7b6d7","repo":"DioxusLabs/dioxus","slug":"err","errorCode":null,"errorMessage":"{err}","messagePattern":"\\{err\\}","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/router/src/contexts/router.rs","lineNumber":278,"sourceCode":"    /// The route that is currently active.\n    pub fn current<R: Routable>(&self) -> R {\n        let absolute_route = self.full_route_string();\n        // If this is a child route, map the absolute route to the child route before parsing\n        let mapping = consume_child_route_mapping::<R>();\n        let route = match mapping.as_ref() {\n            Some(mapping) => mapping\n                .parse_route_from_root_route(&absolute_route)\n                .ok_or_else(|| \"Failed to parse route\".to_string()),\n            None => {\n                R::from_str(&absolute_route).map_err(|err| format!(\"Failed to parse route {err}\"))\n            }\n        };\n\n        match route {\n            Ok(route) => route,\n            Err(err) => {\n                dioxus_core::throw_error(ParseRouteError { message: err });\n                \"/\".parse().unwrap_or_else(|err| panic!(\"{err}\"))\n            }\n        }\n    }\n\n    /// The full route that is currently active. If this is called from inside a child router, this will always return the parent's view of the route.\n    pub fn full_route_string(&self) -> String {\n        let inner = self.inner.read();\n        inner.subscribe_to_current_context();\n        let history = history();\n        history.current_route()\n    }\n\n    /// The prefix that is currently active.\n    pub fn prefix(&self) -> Option<String> {\n        let history = history();\n        history.current_prefix()\n    }\n","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/router/src/contexts/router.rs#L260-L296","documentation":"Router::current failed to parse the current URL into the requested Routable type. Either the child-route mapping failed to resolve the absolute route, or R::from_str rejected the full route string; the wrapped error string is surfaced verbatim.","triggerScenarios":"Thrown at packages/router/src/contexts/router.rs:278 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The router reported the embedded error. Fix the failing navigation, route parsing, or external redirect it describes."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}