Skip to content

Commit

Permalink
Permission denied error handling (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-bc authored Jun 26, 2023
1 parent 4e7c6ab commit 0790679
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/fprime/util/cookiecutter_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ def new_component(build: Build):
print(f"{out_directory_error}", file=sys.stderr)
except CMakeExecutionException as exc:
print(f"[ERROR] Failed to create component. {exc}", file=sys.stderr)
except FileNotFoundError as e:
print(
f"{e}. Permission denied to write to the directory.",
file=sys.stderr,
)
return 1
except OSError as ose:
print(f"[ERROR] {ose}")
return 1
Expand Down Expand Up @@ -257,6 +263,12 @@ def new_deployment(build: Build, parsed_args):
file=sys.stderr,
)
return 1
except FileNotFoundError as e:
print(
f"{e}. Permission denied to write to the directory.",
file=sys.stderr,
)
return 1
print(f"[INFO] New deployment successfully created: {gen_path}")
return 0

Expand Down Expand Up @@ -288,6 +300,12 @@ def new_project(parsed_args):
file=sys.stderr,
)
return 1
except FileNotFoundError as e:
print(
f"{e}. Permission denied to write to the directory.",
file=sys.stderr,
)
return 1
print(f"[INFO] New project successfully created: {gen_path}")
return 0

Expand Down

0 comments on commit 0790679

Please sign in to comment.