template_utils.rs: Add error message when a template can't be found
This commit is contained in:
		
							parent
							
								
									20a6291ac9
								
							
						
					
					
						commit
						f0f799a693
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
					@ -1,3 +1,4 @@
 | 
				
			||||||
 | 
					use log::error;
 | 
				
			||||||
use serde::Serialize;
 | 
					use serde::Serialize;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use crate::errors::UserError;
 | 
					use crate::errors::UserError;
 | 
				
			||||||
| 
						 | 
					@ -12,6 +13,7 @@ pub fn render_template(
 | 
				
			||||||
            .render(name, args)
 | 
					            .render(name, args)
 | 
				
			||||||
            .map_err(|_| UserError::InternalError)?)
 | 
					            .map_err(|_| UserError::InternalError)?)
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
 | 
					        error!("template not found: {}", name);
 | 
				
			||||||
        Err(UserError::NotFound)?
 | 
					        Err(UserError::NotFound)?
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue