Skip to content

Commit e83a0f7

Browse files
committed
error handling
1 parent fed5b5d commit e83a0f7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN apt-get update && \
1010
git config --global user.email "bib@to.ol" && \
1111
git config --global user.name "BibTool"
1212

13-
ENTRYPOINT ["python3", "server.py", "/data/", "main.bib"]
13+
ENTRYPOINT ["python3", "server.py", "/data/", "main.bib", "policy"]
1414

1515
EXPOSE 5000
1616

server.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,11 @@ def version():
387387
repo_path = sys.argv[1]
388388
repo_name = sys.argv[2]
389389
if len(sys.argv) > 3:
390-
print("Import policy %s" % sys.argv[3])
391-
policy = importlib.import_module(sys.argv[3])
390+
try:
391+
print("Import policy %s" % sys.argv[3])
392+
policy = importlib.import_module(sys.argv[3])
393+
except:
394+
policy = None
392395
else:
393396
policy = None
394397

0 commit comments

Comments
 (0)