فهرست منبع

improve index route parsing error message

Evan Almloff 1 سال پیش
والد
کامیت
8a142bbc95
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      packages/router/src/history/memory.rs

+ 3 - 1
packages/router/src/history/memory.rs

@@ -50,7 +50,9 @@ where
 {
     fn default() -> Self {
         Self {
-            current: "/".parse().unwrap_or_else(|err| panic!("{}", err)),
+            current: "/".parse().unwrap_or_else(|err| {
+                panic!("index route does not exist:\n{}\n use MemoryHistory::with_initial_path to set a custom path", err)
+        }),
             history: Vec::new(),
             future: Vec::new(),
         }