Better error handling (2)

This commit is contained in:
Michel Roux 2020-03-22 20:01:18 +01:00
parent a2d691dbf9
commit 409381b5db

View File

@ -4,6 +4,7 @@ from abc import ABC, abstractmethod
from datetime import datetime, timedelta
from enum import Enum
from functools import wraps
from logging import getLogger
from subprocess import run
from sys import platform
from urllib.parse import quote
@ -148,7 +149,7 @@ class Connector(ABC):
output = ''
http_code = 500
if IS_DEBUG:
print(e)
getLogger().exception(e)
else:
if ajax:
headers = {'X-Requested-With': 'XMLHttpRequest'}
@ -167,7 +168,7 @@ class Connector(ABC):
output = ''
http_code = 500
if IS_DEBUG:
print(e)
getLogger().exception(e)
return {'http_code': http_code, 'output': output}