Skip to content

Commit f9e4f91

Browse files
committed
wip
1 parent 779f255 commit f9e4f91

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/dns/parse.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,20 @@ fn parse_record(
3030
Some(record_set)
3131
}
3232

33+
// todo: improve error handling and naming
3334
pub(super) fn parse(
3435
records: HashMap<String, Vec<Vec<String>>>,
3536
) -> Option<HashMap<Name, HashMap<RecordType, Arc<RecordSet>>>> {
3637
let mut result: HashMap<Name, HashMap<RecordType, Arc<RecordSet>>> = Default::default();
3738

3839
for (name, val) in records {
39-
let mut name = Name::from_str(&name).ok()?;
40+
let mut name = match Name::from_str(&name) {
41+
Ok(name) => name,
42+
Err(_) => {
43+
log::error!("Could not parse name {}, skipping", name);
44+
continue
45+
}
46+
};
4047
name.set_fqdn(true);
4148
for val in val {
4249
let mut iter = val.into_iter();

0 commit comments

Comments
 (0)