diff --git a/import_md/hedgedoc_import.py b/import_md/hedgedoc_import.py
index 0b4a3aa5073a94e62701e8f1bafada7ff4faa4b9..72a68386d2e8caa3f08b7f926fa0cf5665abe2bf 100644
--- a/import_md/hedgedoc_import.py
+++ b/import_md/hedgedoc_import.py
@@ -77,6 +77,8 @@ def process_archive_export(archive_file, instance_url, lookup_map, session_id, u
                               "creating a new, random path")
                         new_url = import_single_document(instance_url, "", document_content, session_id)
                         print(f"New URL after document migration without migrating the URL/subpath: {new_url}")
+                    else:
+                        raise SystemExit("Could not create document. Please check your session cookie. Aborting...")
                 urls_to_visit.append(new_url)
                 print()
             else: