File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 11use crate :: error:: Result ;
2- use crate :: web:: rustdoc:: RustdocPage ;
3- use anyhow:: Context ;
2+ use crate :: web:: { report_error , rustdoc:: RustdocPage } ;
3+ use anyhow:: { anyhow , Context } ;
44use rinja:: Template ;
55use std:: { fmt, sync:: Arc } ;
66use tracing:: trace;
@@ -267,8 +267,16 @@ impl IconType {
267267 IconType :: Brand => font_awesome_as_a_crate:: Type :: Brands ,
268268 } ;
269269
270- let icon_file_string = font_awesome_as_a_crate:: svg ( type_, icon_name)
271- . map_err ( |err| rinja:: Error :: Custom ( Box :: new ( err) ) ) ?;
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+ } ;
272280
273281 let mut classes = vec ! [ "fa-svg" ] ;
274282 if fw {
You can’t perform that action at this time.
0 commit comments