[fs2zammad] fix error handling on ticket creation (previously ignored)

This commit is contained in:
fnux 2024-05-07 13:58:10 +02:00
parent 50084f6ab3
commit ac8807167c
No known key found for this signature in database
GPG key ID: 4502C902C00A1E12

View file

@ -6,6 +6,7 @@ import os
import pickle import pickle
import sys import sys
import html2text import html2text
import traceback
from zammad_py import ZammadAPI from zammad_py import ZammadAPI
from zammad_py.api import Resource, TagList, TicketArticle from zammad_py.api import Resource, TagList, TicketArticle
@ -245,6 +246,9 @@ def create_zammad_ticket(id, zammad, h2t, retries=3):
print(f"Failed to import RT-#{id} .. ({retries} retries left)") print(f"Failed to import RT-#{id} .. ({retries} retries left)")
if retries > 0: if retries > 0:
create_zammad_ticket(id, zammad, h2t, retries - 1) create_zammad_ticket(id, zammad, h2t, retries - 1)
else:
traceback.print_exc()
raise RuntimeError
### main logic ### ### main logic ###