Skip to content

Commit

Permalink
feat: output errors are verbose
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
  • Loading branch information
jkowalleck committed Mar 24, 2022
1 parent 8f4db6b commit bfe8fb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cyclonedx/output/__init__.py
Expand Up @@ -93,10 +93,10 @@ def output_to_file(self, filename: str, allow_overwrite: bool = False) -> None:
output_directory = os.path.dirname(output_filename)

if not os.access(output_directory, os.W_OK):
raise PermissionError
raise PermissionError(output_directory)

if os.path.exists(output_filename) and not allow_overwrite:
raise FileExistsError
raise FileExistsError(output_filename)

with open(output_filename, mode='wb') as f_out:
f_out.write(self.output_as_string().encode('utf-8'))
Expand Down

0 comments on commit bfe8fb1

Please sign in to comment.