1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-28 21:10:37 +02:00

improve malformed path error message (#384)

This commit is contained in:
Aravinth Manivannan
2021-08-06 22:36:29 +05:30
committed by GitHub
parent 5379a46a99
commit 48b2e11509

View File

@ -927,7 +927,9 @@ impl ResourceDef {
} }
_ => false, _ => false,
}) })
.expect("malformed dynamic segment"); .unwrap_or_else(|| {
panic!(r#"path "{}" contains malformed dynamic segment"#, pattern)
});
let (mut param, mut unprocessed) = pattern.split_at(close_idx + 1); let (mut param, mut unprocessed) = pattern.split_at(close_idx + 1);