adding latest

This commit is contained in:
2021-11-04 08:39:00 +00:00
parent 83db380fec
commit 37657563a0
3 changed files with 104 additions and 11 deletions

View File

@@ -173,25 +173,21 @@ def _new_create_scoped_page(config_scope: dict, inputs: Collection[str]) -> page
try:
return pages.ScopedPageCreator(page_creator_options).create_page()
except exceptions.BasePathDoesNotExistError as base_path_does_not_exist_error:
tembo.cli.logger.critical(base_path_does_not_exist_error)
cli_message(base_path_does_not_exist_error.args[0])
raise SystemExit(1) from base_path_does_not_exist_error
except exceptions.TemplateFileNotFoundError as template_file_not_found_error:
tembo.cli.logger.critical(template_file_not_found_error.args[0])
cli_message(template_file_not_found_error.args[0])
raise SystemExit(1) from template_file_not_found_error
except exceptions.MismatchedTokenError as mismatched_token_error:
if config_scope["example"] is not None:
tembo.cli.logger.critical(
"Your tembo config.yml/template specifies %s input tokens, you gave %s. Example: %s",
mismatched_token_error.expected,
mismatched_token_error.given,
config_scope["example"],
cli_message(
f'Your tembo config.yml/template specifies {mismatched_token_error.expected} input tokens, you gave {mismatched_token_error.given}. Example: {config_scope["example"]}'
)
raise SystemExit(1) from mismatched_token_error
tembo.cli.logger.critical(
"Your tembo config.yml/template specifies %s input tokens, you gave %s",
mismatched_token_error.expected,
mismatched_token_error.given,
cli_message(
f'Your tembo config.yml/template specifies {mismatched_token_error.expected} input tokens, you gave {mismatched_token_error.given}'
)
raise SystemExit(1) from mismatched_token_error