Skip to content

Commit 83909af

Browse files
sypharGuillaumeGomez
authored andcommitted
Revert "hotfix: don't fail on invalid font-awesome icons, just report"
This reverts commit de1f9e7.
1 parent de1f9e7 commit 83909af

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/web/page/templates.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::error::Result;
2-
use crate::web::{report_error, rustdoc::RustdocPage};
3-
use anyhow::{anyhow, Context};
2+
use crate::web::rustdoc::RustdocPage;
3+
use anyhow::Context;
44
use rinja::Template;
55
use std::{fmt, sync::Arc};
66
use tracing::trace;
@@ -267,16 +267,8 @@ impl IconType {
267267
IconType::Brand => font_awesome_as_a_crate::Type::Brands,
268268
};
269269

270-
let icon_file_string = match font_awesome_as_a_crate::svg(type_, icon_name) {
271-
Ok(s) => s,
272-
Err(err) => {
273-
report_error(&anyhow!(err).context(format!(
274-
"error trying to render icon with name \"{}\"",
275-
icon_name
276-
)));
277-
""
278-
}
279-
};
270+
let icon_file_string = font_awesome_as_a_crate::svg(type_, icon_name)
271+
.map_err(|err| rinja::Error::Custom(Box::new(err)))?;
280272

281273
let mut classes = vec!["fa-svg"];
282274
if fw {

0 commit comments

Comments
 (0)