Skip to content

Commit 121eb7a

Browse files
committed
feat: Add warning logs for status code parsing failures
1 parent 02ca950 commit 121eb7a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/lib.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,18 @@ fn parse_status_codes(input: &str) -> Vec<u16> {
136136
return (start..=end).collect::<Vec<_>>();
137137
}
138138
}
139+
tracing::warn!("Failed to parse status code range: {}", part);
139140
vec![]
140141
} else {
141-
part.parse::<u16>().map_or(vec![], |code| vec![code])
142+
part.parse::<u16>().map_or_else(
143+
|_| {
144+
if !part.is_empty() {
145+
tracing::warn!("Failed to parse status code: {}", part);
146+
}
147+
vec![]
148+
},
149+
|code| vec![code],
150+
)
142151
}
143152
})
144153
.collect()

0 commit comments

Comments
 (0)