Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
oee-services
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
harshavardhan.c
oee-services
Commits
abd27efe
Commit
abd27efe
authored
May 26, 2022
by
shreya.m
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated format strucrture
parent
76bff425
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
293 additions
and
77 deletions
+293
-77
scripts/constants/__init__.py
scripts/constants/__init__.py
+6
-4
scripts/constants/app_constants.py
scripts/constants/app_constants.py
+150
-0
scripts/constants/db_keys.py
scripts/constants/db_keys.py
+2
-0
scripts/core/handlers/oee_handlers.py
scripts/core/handlers/oee_handlers.py
+25
-40
scripts/db/mongo/ilens_assistant/__init__.py
scripts/db/mongo/ilens_assistant/__init__.py
+0
-0
scripts/db/mongo/ilens_assistant/aggregations/__init__.py
scripts/db/mongo/ilens_assistant/aggregations/__init__.py
+0
-0
scripts/db/mongo/ilens_assistant/collection/__init__.py
scripts/db/mongo/ilens_assistant/collection/__init__.py
+0
-0
scripts/db/mongo/ilens_assistant/collection/tag_instance_data.py
.../db/mongo/ilens_assistant/collection/tag_instance_data.py
+54
-0
scripts/schemas/batch_oee.py
scripts/schemas/batch_oee.py
+2
-2
scripts/services/__init__.py
scripts/services/__init__.py
+2
-0
scripts/services/oee_services.py
scripts/services/oee_services.py
+52
-31
No files found.
scripts/constants/__init__.py
View file @
abd27efe
...
@@ -19,10 +19,12 @@ class Endpoints:
...
@@ -19,10 +19,12 @@ class Endpoints:
api_hierarchy
=
"/hierarchy"
api_hierarchy
=
"/hierarchy"
hierarchy_api
=
'ilens_config/get_site_level_hierarchy'
hierarchy_api
=
'ilens_config/get_site_level_hierarchy'
#OEE SERVICES
# OEE SERVICES
oee_services
=
"/oee"
api_oee_services
=
"/oee_services"
oee_services
=
"/oee_post"
api_save_tag
=
"/save"
api_delete_tag
=
"/delete"
api_update_tag
=
"/update"
api_get_tag
=
"/get"
class
StatusCodes
:
class
StatusCodes
:
...
...
scripts/constants/app_constants.py
0 → 100644
View file @
abd27efe
class
DatabaseNames
:
ilens_assistant
=
"ilens_assistant"
class
CollectionNames
:
oee_tags
=
"oeetags"
# class TableContent:
# FETCH_STEP_HEADER_CONTENT = [
# {
# "value": "step_name",
# "label": "Step Name",
# "enableClick": True,
# "style": "indicate-item cursor-pointer",
# "action": {"action": "edit", "label": "Edit", "type": "edit"}
# },
# {
# "value": "description",
# "label": "Description"
# }
# ]
# fetch_step_table_actions = {
# "actions": [
# {
# "action": "edit",
# "label": "Edit",
# "type": "edit",
# "icon-class": "fa fa-pencil"
# },
# {
# "action": "delete",
# "label": "Delete",
# "type": "delete",
# "icon-class": "fa fa-trash"
# }
# ],
# "enableActions": True,
# "externalActions": [
# {
# "action": "addnew",
# "label": "Create New",
# "type": "addnew"
# }
# ]
# }
#
#
# class StatusResponses:
# PLANNED = "PLANNED"
# ALL = "ALL"
# PENDING = "PENDING"
# COMPLETED = "COMPLETED"
# PENDING_FOR_REVIEW = "PENDING_FOR_REVIEW"
# PENDING_FOR_APPROVAL = "PENDING_FOR_APPROVAL"
# IN_PROGRESS = "IN_PROGRESS"
# REVIEW_REJECTED = "REVIEW_REJECTED"
# APPROVAL_REJECTED = "APPROVAL_REJECTED"
# APPROVED = "APPROVED"
# IS_STARTED = "is_started"
# IS_TASK_COMPLETED = "is_task_completed"
# IS_PAUSED = "is_paused"
# CLOSED = "CLOSED"
# RESOLVED = "RESOLVED"
#
#
# class UserRoleCollectionKeys:
# KEY_USER_ROLE_ID = "user_role_id"
# KEY_PROJECT_ID = "project_id"
#
#
# class SiteConfCollectionKeys:
# KEY_SITE_NAME = "site_name"
# KEY_SITE_INFO = "site_info"
# KEY_CUSTOMER_PROJECT_ID = "customer_project_id"
# KEY_SITE_ID = "site_id"
# KEY_PRODUCT_ENCRYPTED = "product_encrypted"
# KEY_PROCESS_ID = "process_id"
#
#
# class CustomerProjectKeys:
# KEY_CUSTOMER_PROJECT_ID = "customer_project_id"
# KEY_CUSTOMER_PROJECT_NAME = "customer_project_name"
# KEY_SITE_TEMPLT_ID = "site_templt_id"
# KEY_PROCESS_TEMPLT_ID = "process_templt_id"
#
#
# class DBConsts:
# kairos_std_metric_name = 'ilens.live_data.raw'
# kairos_column_names = ["timestamp", "value"]
# kairos_time_unit = "ms"
# kairos_version_api = "/api/v1/version"
# kairos_health_check = "/api/v1/health/status"
# kairos_query_api = "/api/v1/datapoints/query"
# kairos_write_data_api = "/api/v1/datapoints"
#
#
# class Secrets:
# LOCK_OUT_TIME_MINS = 30
# leeway_in_mins = 10
# unique_key = '45c37939-0f75'
# token = '8674cd1d-2578-4a62-8ab7-d3ee5f9a'
# issuer = "ilens"
# alg = "RS256"
#
#
# class StepCategories:
# NON_PERIODIC = "step_category_100"
# TASK_CREATION = "step_category_101"
# PERIODIC = "step_category_102"
# TRIGGER_BASED = "step_category_103"
#
#
# class CommonStatusCode:
# SUCCESS_CODES = (
# 200,
# 201,
# 204,
# )
#
#
# class EmailAuth:
# username = 'AllGoodNamesRGone'
# password = 'comBRANSeANtamasEbICaPeC'
#
#
# class JsonFormats:
# missed_task_format = {
# "className": "scheduledTask",
# "end": "NA",
# "id": "",
# "start": "",
# "title": "",
# "textColor": "#000000",
# "backgroundColor": "",
# "data": {
# "future_task": True,
# "id": "",
# "info": {
# "Logbook Name": "",
# "Hierarchy": "",
# "Created By": ""
# },
# "critical": False,
# "task_category": "",
# "bgColor": "",
# "created_at": ""
# }
# }
scripts/constants/db_keys.py
0 → 100644
View file @
abd27efe
class
TagInstanceDataKeys
:
KEY_PROJECT_ID
=
"task_id"
scripts/core/handlers/oee_handlers.py
View file @
abd27efe
import
traceback
import
traceback
from
scripts.db.mongo.ilens_assistant.collection.tag_instance_data
import
TagInstanceData
from
scripts.schemas.batch_oee
import
GetOeeServices
from
scripts.logging
import
logger
from
scripts.logging
import
logger
from
scripts.utils.mongo_util
import
MongoCollectionBaseClass
from
scripts.utils.mongo_util
import
MongoCollectionBaseClass
from
scripts.schemas.oee_config_schema
import
Oee_Tag_Mapping_List
,
Get_Oee_Tag
,
Update_Oee_Tags
,
Get_Project_Id
from
scripts.schemas.oee_config_schema
import
Oee_Tag_Mapping_List
,
Get_Oee_Tag
,
Update_Oee_Tags
,
Get_Project_Id
...
@@ -8,47 +10,39 @@ from scripts.db.mongo.ilens_configuration import database
...
@@ -8,47 +10,39 @@ from scripts.db.mongo.ilens_configuration import database
from
scripts.db.mongo.ilens_configuration.collections
import
collection_constants
from
scripts.db.mongo.ilens_configuration.collections
import
collection_constants
from
scripts.utils.mongo_util
import
MongoCollectionBaseClass
from
scripts.utils.mongo_util
import
MongoCollectionBaseClass
from
scripts.schemas
import
mongo_schema
from
scripts.schemas
import
mongo_schema
from
sqlalchemy.orm
import
Session
from
scripts.constants.db_connections
import
mongo_client
from
scripts.constants.db_connections
import
mongo_client
class
OeeServices
:
class
OeeServices
:
def
__init__
(
self
,
project_id
=
Get_Project_Id
.
project_id
):
def
__init__
(
self
,
project_id
=
None
):
try
:
try
:
self
.
connect
=
collection_constants
(
mongo_client
=
mongo_client
)
self
.
tag_data_conn
=
TagInstanceData
(
mongo_client
=
mongo_client
)
except
Exception
as
e
:
except
Exception
as
e
:
tb
=
traceback
.
format_exc
()
raise
logger
.
exception
(
f
"Error while connecting to mongodb {e.args}"
)
logger
.
exception
(
e
)
logger
.
exception
(
tb
)
logger
.
exception
(
"Error while connecting to mongodb"
)
raise
def
oee_tag
(
self
,
oee_tag_list
:
Oee_Tag_Mapping_List
):
def
oee_tag
(
self
,
request_data
:
GetOeeServices
,
db
:
Session
,
user_id
):
try
:
try
:
insert_json
=
{
"hierarchy"
:
oee_tag_list
.
hierarchy
,
insert_json
=
{
"hierarchy"
:
request_data
.
hierarchy
,
"project_id"
:
oee_tag_list
.
project_id
,
"project_id"
:
request_data
.
project_id
,
"meta"
:
oee_tag_list
.
project_id
,
"meta"
:
request_data
.
meta
,
"oee_tag_mapping"
:
oee_tag_list
.
oee_tag_mapping
"oee_tag_mapping"
:
request_data
.
oee_tag_mapping
}
}
result
=
self
.
connect
.
insert_one
(
data
=
insert_json
)
result
=
self
.
tag_data_conn
.
insert_one
(
data
=
insert_json
)
if
result
:
if
result
:
logger
.
info
(
"Data inserted in to mongodb successfully"
)
logger
.
info
(
"Data inserted in to mongodb successfully"
)
else
:
else
:
logger
.
info
(
"Unable to insert data in to Mongodb"
)
logger
.
info
(
"Unable to insert data in to Mongodb"
)
except
Exception
as
e
:
except
Exception
as
e
:
tb
=
traceback
.
format_exc
()
raise
logger
.
exception
(
f
"Error occurred while inserting data{e.args}"
)
logger
.
exception
(
e
)
logger
.
exception
(
tb
)
logger
.
exception
(
"Error occurred while inserting data"
)
raise
def
get_oee_tag
(
self
,
get_oee_tag
:
Get_Oee_Tag
):
def
get_oee_tag
(
self
,
request_data
:
GetOeeServices
,
db
:
Session
):
try
:
try
:
query
=
{
'project_id'
:
get_oee_tag
.
project_id
}
query
=
{
'project_id'
:
request_data
.
project_id
}
skips
=
get_oee_tag
.
page_size
*
(
get_oee_tag
.
page_num
-
1
)
skips
=
request_data
.
page_size
*
(
request_data
.
page_num
-
1
)
no_of_documents
=
self
.
connect
.
count_documents
(
query
=
query
)
no_of_documents
=
self
.
tag_data_conn
.
count_documents
(
query
=
query
)
result
=
self
.
connect
.
find
(
query
=
query
)
.
skip
(
skips
)
.
limit
(
get_oee_tag
.
page_num
)
result
=
self
.
tag_data_conn
.
find
(
query
=
query
)
.
skip
(
skips
)
.
limit
(
request_data
.
page_num
)
if
result
:
if
result
:
# if skips < no_of_documents:
# if skips < no_of_documents:
# return_json["endOfrecords"] = False
# return_json["endOfrecords"] = False
...
@@ -58,29 +52,20 @@ class OeeServices:
...
@@ -58,29 +52,20 @@ class OeeServices:
except
Exception
as
e
:
except
Exception
as
e
:
raise
logger
.
exception
(
f
"Exception occurred while fetching data as {e.args}"
)
raise
logger
.
exception
(
f
"Exception occurred while fetching data as {e.args}"
)
def
delete_oee_tags
(
self
,
request_data
:
GetOeeServices
,
db
:
Session
):
def
delete_oee_tags
(
self
,
project_id
:
Get_Project_Id
):
try
:
try
:
query
=
{
"project_id"
:
project_id
.
project_id
}
query
=
{
"project_id"
:
request_data
.
project_id
}
result
=
self
.
connect
.
delete_one
(
query
=
query
)
result
=
self
.
tag_data_conn
.
delete_one
(
query
=
query
)
if
result
:
if
result
:
return
result
return
result
except
Exception
as
e
:
except
Exception
as
e
:
tb
=
traceback
.
format_exc
()
raise
logger
.
exception
(
f
"Exception occurred while fetching data as {e.args}"
)
logger
.
exception
(
e
)
logger
.
exception
(
tb
)
logger
.
exception
(
f
"Exception occurred while fetching data as {e}"
)
raise
def
update_oee_tags
(
self
,
update_oee_tags
:
Update_Oee_Tags
):
def
update_oee_tags
(
self
,
request_data
:
GetOeeServices
,
db
:
Session
):
try
:
try
:
query
=
{
"project_id"
:
[
'update_oee_tags.project_id'
]}
query
=
{
"project_id"
:
[
'update_oee_tags.project_id'
]}
result
=
self
.
connect
.
update_one
(
query
=
query
)
result
=
self
.
tag_data_conn
.
update_one
(
query
=
query
)
if
result
:
if
result
:
return
result
return
result
except
Exception
as
e
:
except
Exception
as
e
:
tb
=
traceback
.
format_exc
()
raise
logger
.
exception
(
f
"Exception occurred while fetching data as {e.args}"
)
logger
.
exception
(
e
)
logger
.
exception
(
tb
)
logger
.
exception
(
f
"Exception occurred while fetching data as {e}"
)
raise
scripts/db/mongo/ilens_assistant/__init__.py
0 → 100644
View file @
abd27efe
scripts/db/mongo/ilens_assistant/aggregations/__init__.py
0 → 100644
View file @
abd27efe
scripts/db/mongo/ilens_assistant/collection/__init__.py
0 → 100644
View file @
abd27efe
scripts/db/mongo/ilens_assistant/collection/tag_instance_data.py
0 → 100644
View file @
abd27efe
from
typing
import
Optional
,
Dict
,
List
from
scripts.constants.app_constants
import
DatabaseNames
,
CollectionNames
from
scripts.constants.db_keys
import
TagInstanceDataKeys
from
scripts.db.mongo.schema
import
MongoBaseSchema
from
scripts.utils.mongo_util
import
MongoCollectionBaseClass
class
TagInstanceDataSchema
(
MongoBaseSchema
):
"""
This is the Schema for the Mongo DB Collection.
All datastore and general responses will be following the schema.
"""
hierarchy
:
str
project_id
:
str
meta
:
Optional
[
dict
]
oee_tag_mapping
:
Optional
[
str
]
class
TagInstanceData
(
MongoCollectionBaseClass
):
def
__init__
(
self
,
mongo_client
,
project_id
=
None
):
super
()
.
__init__
(
mongo_client
,
database
=
DatabaseNames
.
ilens_assistant
,
collection
=
CollectionNames
.
oee_tags
)
self
.
project_id
=
project_id
@
property
def
key_project_id
(
self
):
return
TagInstanceDataKeys
.
KEY_PROJECT_ID
def
find_data_by_project_id
(
self
,
project_id
):
query
=
{
"project_id"
:
project_id
}
records
=
self
.
find
(
query
)
if
not
records
:
return
list
()
return
records
def
find_data_project_id
(
self
,
project_id
):
query
=
{
"project"
:
project_id
}
record
=
self
.
find_one
(
query
)
if
not
record
:
return
TagInstanceDataSchema
(
**
dict
())
return
TagInstanceDataSchema
(
**
dict
(
record
))
def
find_all_project_instance_data
(
self
,
**
query
):
records
=
self
.
find
(
query
)
if
not
records
:
return
list
()
return
records
def
find_all_project_instance_data_by_dict
(
self
,
query
:
dict
):
records
=
self
.
find
(
query
)
if
not
records
:
return
list
()
return
records
scripts/schemas/batch_oee.py
View file @
abd27efe
...
@@ -217,5 +217,5 @@ class GetBatches(GetOEERequest):
...
@@ -217,5 +217,5 @@ class GetBatches(GetOEERequest):
class
GetOeeServices
(
BaseModel
):
class
GetOeeServices
(
BaseModel
):
hierarchy
:
str
hierarchy
:
str
project_id
:
str
project_id
:
str
meta
:
dict
meta
:
Optional
[
dict
]
oee_tag_mapping
:
str
oee_tag_mapping
:
Optional
[
str
]
scripts/services/__init__.py
View file @
abd27efe
...
@@ -2,7 +2,9 @@ from fastapi import APIRouter
...
@@ -2,7 +2,9 @@ from fastapi import APIRouter
from
scripts.services.calculate_oee
import
calc_oee_router
from
scripts.services.calculate_oee
import
calc_oee_router
# from scripts.services.ui_services import ui_service_router
# from scripts.services.ui_services import ui_service_router
from
scripts.services.oee_services
import
oee_config_router
route
=
APIRouter
()
route
=
APIRouter
()
route
.
include_router
(
calc_oee_router
)
route
.
include_router
(
calc_oee_router
)
route
.
include_router
(
oee_config_router
)
# route.include_router(ui_service_router)
# route.include_router(ui_service_router)
scripts/services/oee_services.py
View file @
abd27efe
from
fastapi
import
APIRouter
from
scripts.core.handlers.oee_handlers
import
OeeServices
from
scripts.logging
import
logger
from
scripts.logging
import
logger
from
scripts.constants
import
Endpoints
from
scripts.constants
import
Endpoints
from
scripts.schemas.batch_oee
import
GetOeeServices
from
scripts.schemas.batch_oee
import
GetOeeServices
from
scripts.core.handlers
import
oee_handlers
from
scripts.core.handlers
import
oee_handlers
import
traceback
import
traceback
from
fastapi
import
APIRouter
,
Depends
from
scripts.utils.security_utils.cookie_decorator
import
MetaInfoCookie
,
MetaInfoSchema
from
scripts.schemas.response_models
import
DefaultFailureResponse
,
DefaultResponse
from
scripts.utils.security_utils.cookie_decorator
import
MetaInfoCookie
from
scripts.db.psql.databases
import
get_db
from
scripts.utils.security_utils.decorators
import
CookieAuthentication
from
scripts.schemas.response_models
import
DefaultFailureResponse
get_cookies
=
MetaInfoCookie
()
oee_config_router
=
APIRouter
(
prefix
=
Endpoints
.
api_oee_services
,
tags
=
[
"OEE Configuration"
])
auth
=
CookieAuthentication
()
oee_services
=
APIRouter
(
prefix
=
Endpoints
.
oee_services
,
tags
=
[
"OEE Calculator"
])
@
oee_config_router
.
post
(
Endpoints
.
api_save_tag
)
@
oee_services
.
post
(
Endpoints
.
oee_services
)
def
save_oee_tag
(
request_data
:
GetOeeServices
,
user_id
=
Depends
(
auth
),
db
=
Depends
(
get_db
),
async
def
oee_tag
(
oee_tag_mapping_list
:
GetOeeServices
):
meta
:
MetaInfoSchema
=
Depends
(
get_cookies
)
):
try
:
try
:
tag_mapping
=
oee_tag_mapping_list
.
dict
()
oee_services
=
OeeServices
(
project_id
=
meta
.
project_id
)
result
=
oee_handlers
.
OeeServices
.
oee_tag
(
oee_tag_mapping_list
)
result
=
oee_services
.
oee_tag
(
request_data
,
user_id
,
db
)
return
result
if
result
:
return
DefaultResponse
(
message
=
'Oee Tag Saved Successfully'
,
data
=
result
)
except
Exception
as
e
:
except
Exception
as
e
:
tb
=
traceback
.
format_exc
()
tb
=
traceback
.
format_exc
()
logger
.
exception
(
e
)
logger
.
exception
(
e
)
logger
.
exception
(
tb
)
logger
.
exception
(
tb
)
return
DefaultFailureResponse
(
error
=
e
.
args
)
.
dict
()
return
DefaultFailureResponse
(
error
=
e
.
args
)
@
oee_services
.
post
(
Endpoints
.
oee_services
)
@
oee_config_router
.
post
(
Endpoints
.
api_get_tag
)
async
def
get_oee_tag
(
get_oee_tags
:
GetOeeServices
):
def
get_oee_tag
(
request_data
:
GetOeeServices
,
db
=
Depends
(
get_db
),
meta
:
MetaInfoSchema
=
Depends
(
get_cookies
)):
try
:
try
:
get_oee_tags
=
get_oee_tags
.
dict
()
oee_services
=
OeeServices
(
project_id
=
meta
.
project_id
)
return_json
=
oee_handlers
.
OeeServices
.
get_oee_tag
(
get_oee_tags
)
result
=
oee_services
.
get_oee_tag
(
request_data
,
db
)
return
return_json
if
result
:
return
DefaultResponse
(
message
=
'Record Fetched Successfully'
,
data
=
result
)
return
DefaultFailureResponse
(
status
=
'failed'
,
message
=
'Record Not Found'
,
data
=
{})
except
Exception
as
e
:
except
Exception
as
e
:
raise
logger
.
exception
(
f
"Error while getting information as {e}"
)
tb
=
traceback
.
format_exc
()
logger
.
exception
(
e
)
logger
.
exception
(
tb
)
return
DefaultFailureResponse
(
error
=
e
.
args
)
.
dict
()
@
oee_services
.
post
(
Endpoints
.
oee_services
)
@
oee_config_router
.
post
(
Endpoints
.
api_delete_tag
)
async
def
delete_oee_tag
(
delete_oee_tags
:
GetOeeServices
):
def
delete_oee_tag
(
request_data
:
GetOeeServices
,
db
=
Depends
(
get_db
),
meta
:
MetaInfoSchema
=
Depends
(
get_cookies
)):
try
:
try
:
delete_oee_tags
=
delete_oee_tags
.
dict
(
)
oee_services
=
OeeServices
(
project_id
=
meta
.
project_id
)
re
turn_json
=
oee_handlers
.
OeeServices
.
delete_oee_tags
(
project_id
=
delete_oee_tags
[
"project_id"
]
)
re
sult
=
oee_services
.
delete_oee_tags
(
request_data
,
db
)
return
return_json
if
result
:
return
DefaultResponse
(
message
=
'Record Deleted Successfully'
,
data
=
result
)
except
Exception
as
e
:
except
Exception
as
e
:
raise
logger
.
exception
(
f
"Error while getting information as {e}"
)
tb
=
traceback
.
format_exc
()
logger
.
exception
(
e
)
logger
.
exception
(
tb
)
return
DefaultFailureResponse
(
error
=
e
.
args
)
.
dict
()
@
oee_services
.
post
(
Endpoints
.
oee_services
)
@
oee_config_router
.
post
(
Endpoints
.
api_update_tag
)
async
def
update_oee_tag
(
update_oee_tags
:
GetOeeServices
):
def
update_oee_tag
(
request_data
:
GetOeeServices
,
db
=
Depends
(
get_db
),
meta
:
MetaInfoSchema
=
Depends
(
get_cookies
)):
try
:
try
:
update_oee_tags
=
update_oee_tags
.
dict
(
)
oee_services
=
OeeServices
(
project_id
=
meta
.
project_id
)
re
turn_json
=
oee_handlers
.
OeeServices
.
update_oee_tags
(
update_oee_tags
)
re
sult
=
oee_services
.
update_oee_tags
(
request_data
,
db
)
return
return_json
if
result
:
return
DefaultResponse
(
message
=
'DowntimeLog Updated Successfully'
,
data
=
result
)
except
Exception
as
e
:
except
Exception
as
e
:
raise
logger
.
exception
(
f
"Error while getting information as {e}"
)
tb
=
traceback
.
format_exc
()
logger
.
exception
(
e
)
logger
.
exception
(
tb
)
return
DefaultFailureResponse
(
error
=
e
.
args
)
.
dict
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment