Skip to content

Commit 4618c62

Browse files
authored
Merge pull request #198 from CycloneDX/verbose_outout_errors
fix: improved output errors - file/directory is now included
2 parents 6ccb637 + bfe8fb1 commit 4618c62

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cyclonedx/output/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ def output_to_file(self, filename: str, allow_overwrite: bool = False) -> None:
9393
output_directory = os.path.dirname(output_filename)
9494

9595
if not os.access(output_directory, os.W_OK):
96-
raise PermissionError
96+
raise PermissionError(output_directory)
9797

9898
if os.path.exists(output_filename) and not allow_overwrite:
99-
raise FileExistsError
99+
raise FileExistsError(output_filename)
100100

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

0 commit comments

Comments
 (0)