Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Loader::lookup/lookup_complete/lookup_with_args return Option<String> #33

Merged
merged 3 commits into from
Mar 19, 2022

Conversation

jamolnng
Copy link
Contributor

Loader::lookup/lookup_complete/lookup_with_args now return
Option<String> so the user can control what happens when a lookup
returns nothing.

Ref: #32

Loader::lookup/lookup_complete/lookup_with_args now return
Option<String> so the user can control what happens when a lookup
returns nothing.
Modified the tests to support the new Option<String> returned by
Loader::lookup_complete/lookup_with_args/lookup
Both Tera and Handlebars now return an error from their respective
call() functions if the loader cannot find a lookup for the given id
via:

match response {
  Some(response) => Ok(Json::String(response)),
  None => Err(...(format!("Unknown localization {}", id))),
}
@XAMPPRocky
Copy link
Owner

Thank you for your PR, and congrats on your first contribution! 🎉

@XAMPPRocky XAMPPRocky merged commit df48798 into XAMPPRocky:master Mar 19, 2022
debug-richard added a commit to debug-richard/fluent-templates that referenced this pull request May 1, 2023
@github-actions github-actions bot mentioned this pull request Mar 4, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants