Skip to content

Commit eb40bac

Browse files
Apply feedback from review
Co-Authored-By: Jeremiah Senkpiel <[email protected]>
1 parent d71214c commit eb40bac

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/other/source_map.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl SourceMap {
6060
Ok(url) => url,
6161
Err(_) => match base_url.try_into() {
6262
Ok(base_url) => base_url.join(header_value.as_str().trim()).status(400)?,
63-
Err(_) => bail!(400, "Invalid base url provided"),
63+
Err(_) => bail!(500, "Invalid base url provided"),
6464
},
6565
};
6666

@@ -91,14 +91,13 @@ impl SourceMap {
9191
}
9292

9393
/// Set the url.
94-
pub fn set_location<U>(&mut self, location: U)
94+
pub fn set_location<U>(&mut self, location: U) -> Result<(), U::Error>
9595
where
9696
U: TryInto<Url>,
9797
U::Error: std::fmt::Debug,
9898
{
99-
self.location = location
100-
.try_into()
101-
.expect("Could not convert into valid URL")
99+
self.location = location.try_into()?;
100+
Ok(())
102101
}
103102
}
104103

0 commit comments

Comments
 (0)