Better error handling (2)
This commit is contained in:
parent
a2d691dbf9
commit
409381b5db
@ -4,6 +4,7 @@ from abc import ABC, abstractmethod
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
from logging import getLogger
|
||||||
from subprocess import run
|
from subprocess import run
|
||||||
from sys import platform
|
from sys import platform
|
||||||
from urllib.parse import quote
|
from urllib.parse import quote
|
||||||
@ -148,7 +149,7 @@ class Connector(ABC):
|
|||||||
output = ''
|
output = ''
|
||||||
http_code = 500
|
http_code = 500
|
||||||
if IS_DEBUG:
|
if IS_DEBUG:
|
||||||
print(e)
|
getLogger().exception(e)
|
||||||
else:
|
else:
|
||||||
if ajax:
|
if ajax:
|
||||||
headers = {'X-Requested-With': 'XMLHttpRequest'}
|
headers = {'X-Requested-With': 'XMLHttpRequest'}
|
||||||
@ -167,7 +168,7 @@ class Connector(ABC):
|
|||||||
output = ''
|
output = ''
|
||||||
http_code = 500
|
http_code = 500
|
||||||
if IS_DEBUG:
|
if IS_DEBUG:
|
||||||
print(e)
|
getLogger().exception(e)
|
||||||
|
|
||||||
return {'http_code': http_code, 'output': output}
|
return {'http_code': http_code, 'output': output}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user