1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-01-31 03:42:08 +01: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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);