Fix key error + log exceptions to error.log

This commit is contained in:
relikd
2020-09-05 23:30:37 +02:00
parent 6f215595b6
commit 724d7ab319
4 changed files with 38 additions and 26 deletions

View File

@@ -6,6 +6,7 @@ import glob
import json
import shutil
import logging
import traceback
from pathlib import Path
import urllib.request as curl
@@ -77,6 +78,8 @@ def valid_bundle_id(bundle_id):
def err(scope, msg, logOnly=False):
if isinstance(msg, Exception):
msg = traceback.format_exc()
logger.error('[{}] {}'.format(scope, msg))
if not logOnly:
print(' [ERROR] ' + msg)