Skip to content

Commit b07bd05

Browse files
committed
Handle missing attachment
1 parent 11861a2 commit b07bd05

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

confluence_markdown_exporter/confluence.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,12 @@ def export(self, export_path: StrPath) -> None:
276276
if filepath.exists():
277277
return
278278

279-
response = confluence._session.get(str(confluence.url + self.download_link))
280-
response.raise_for_status() # Raise error if request fails
279+
try:
280+
response = confluence._session.get(str(confluence.url + self.download_link))
281+
response.raise_for_status() # Raise error if request fails
282+
except HTTPError:
283+
print(f"There is no attachment with titel '{self.title}'. Skipping export.")
284+
return
281285

282286
save_file(
283287
filepath,

0 commit comments

Comments
 (0)