Skip to content

Commit

Permalink
Raise PermissionError instead of warning
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-bc committed Nov 13, 2023
1 parent cc9c2fc commit 9bcd0e0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/fprime_gds/common/pipeline/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def setup_file_handling(
self, down_store, file_encoder, file_decoder, distributor, log_dir
):
"""
Sets up the file handling (uplink and downlink) from a pair of encoders and decoders
Sets up the file handling (uplink and downlink) from a pair of encoders and decoders.
Raises a PermissionError if the down_store is not writable.
:param down_store: downlink storage directory
:param file_encoder: file encoder for uplink
Expand All @@ -43,9 +44,9 @@ def setup_file_handling(
file_decoder.register(self.__downlinker)
distributor.register("FW_PACKET_HAND", self.__uplinker)
if not os.access(down_store, os.W_OK):
print(
f"[WARNING] {down_store} is not writable. Downlinker will not be able to save files."
" Fix permissions or change storage directory with --file-storage-directory"
raise PermissionError(
f"{down_store} is not writable. Downlinker not be able to save files. "
"Fix permissions or change storage directory with --file-storage-directory."
)

@property
Expand Down

0 comments on commit 9bcd0e0

Please sign in to comment.