Issue #140: add error handling.

This commit is contained in:
Sergey Vartanov 2022-08-17 09:30:13 +03:00
parent 692997f54a
commit 199dff9599

View file

@ -263,9 +263,11 @@ def render_map(arguments: argparse.Namespace) -> None:
:param arguments: command-line arguments
"""
scheme: Scheme = Scheme.from_file(
workspace.find_scheme_path(arguments.scheme)
)
scheme_path: Optional[Path] = workspace.find_scheme_path(arguments.scheme)
if scheme_path is None:
fatal(f"Scheme `{arguments.scheme}` not found.")
scheme: Scheme = Scheme.from_file(scheme_path)
configuration: MapConfiguration = MapConfiguration.from_options(
scheme, arguments, float(arguments.zoom)