Skip to content

Commit

Permalink
improve error log for missing bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
tronicboy1 committed Jan 24, 2024
1 parent 4b80a41 commit 8eb2156
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ impl tera::Function for Localizer {
.and_then(|key| key.as_str())
.ok_or(tera::Error::msg("missing ftl key"))?;

let bundle = self
.get_locale(&lang_arg)
.ok_or(tera::Error::msg("locale not registered"))?;
let bundle = self.get_locale(&lang_arg).ok_or(tera::Error::msg(format!(
"locale not registered: {lang_arg}"
)))?;

let msg = bundle
.get_message(ftl_key)
Expand Down

0 comments on commit 8eb2156

Please sign in to comment.