From 1663a4f0d6e9ce6cb82cd77f8aa0f81a0404a8c7 Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Sun, 10 Oct 2021 12:36:30 +0200 Subject: [PATCH] better error handling --- server.py | 3 +-- templates/index.html | 10 ++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/server.py b/server.py index de193d7..3182e77 100755 --- a/server.py +++ b/server.py @@ -28,11 +28,10 @@ def root(): allFiles = [] loaded = None for filename in glob.glob("static/files/*.pdf"): - loaded = parserBackend.load(filename) try: loaded = parserBackend.load(filename) except Exception: - loaded = BlowerdoorData(os.path.basename(filename), os.path.basename(filename), "", "", datetime.datetime.now(), datetime.datetime.now()) + loaded = BlowerdoorData(os.path.basename(filename), os.path.basename(filename), "Fehler", "Fehler", datetime.datetime.now(), datetime.datetime.now()) allFiles.append(loaded) # check duplicates diff --git a/templates/index.html b/templates/index.html index f75c2b6..78d7b69 100644 --- a/templates/index.html +++ b/templates/index.html @@ -29,13 +29,19 @@ {{ bd.docName }} {% if bd.outdated %}

(neueres Dokument verfügbar: {{ bd.inDocumentDate.strftime("%d.%m.%Y") }})

{% endif %} - {{ bd.location }} + + {{ bd.location }} {% if bd.blowerdoorDate %} {{ bd.blowerdoorDate }} {% else %} 0000 - Keine Informationen Gefunden {% endif %} - {{ bd.customer }} + + {{ bd.customer }} {{ bd.pdfDate.strftime("%Y/%m/%d") }} {% endfor %}