Skip to content

Commit 48b2e11

Browse files
authored
improve malformed path error message (#384)
1 parent 5379a46 commit 48b2e11

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

actix-router/src/resource.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,9 @@ impl ResourceDef {
927927
}
928928
_ => false,
929929
})
930-
.expect("malformed dynamic segment");
930+
.unwrap_or_else(|| {
931+
panic!(r#"path "{}" contains malformed dynamic segment"#, pattern)
932+
});
931933

932934
let (mut param, mut unprocessed) = pattern.split_at(close_idx + 1);
933935

0 commit comments

Comments
 (0)