feat: bi查询报错后打日志
This commit is contained in:
parent
28e5b83896
commit
2753c78997
|
@ -12,6 +12,8 @@ from apps.bi.services import check_sql_safe, format_json_with_placeholders
|
||||||
from rest_framework.exceptions import ParseError
|
from rest_framework.exceptions import ParseError
|
||||||
from rest_framework.generics import get_object_or_404
|
from rest_framework.generics import get_object_or_404
|
||||||
from apps.utils.mixins import ListModelMixin
|
from apps.utils.mixins import ListModelMixin
|
||||||
|
import logging
|
||||||
|
myLogger = logging.getLogger('log')
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
|
|
||||||
|
|
||||||
|
@ -101,6 +103,7 @@ class DatasetViewSet(CustomModelViewSet):
|
||||||
results[name], results2[name] = format_sqldata(
|
results[name], results2[name] = format_sqldata(
|
||||||
res[0], res[1])
|
res[0], res[1])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
myLogger.error(f'bi查询异常:{str(e)}-{dt.code}--{sql_f}')
|
||||||
if raise_exception:
|
if raise_exception:
|
||||||
raise ParseError(f'查询异常:{str(e)}')
|
raise ParseError(f'查询异常:{str(e)}')
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue