diff --git a/Python_Engine/Python/src/python_toolkit/bhom/analytics.py b/Python_Engine/Python/src/python_toolkit/bhom/analytics.py index fbffddf..4b684a3 100644 --- a/Python_Engine/Python/src/python_toolkit/bhom/analytics.py +++ b/Python_Engine/Python/src/python_toolkit/bhom/analytics.py @@ -105,7 +105,7 @@ def summarise_usage_logs(usage_log_entries:List[UsageLogEntry]) -> List[Dict]: def convert_exc_info_to_bhom_error(exc_info): time = bson_unix_ticks(datetime.now(), short=True) utcTime = bson_unix_ticks(short=True) - stack_trace = traceback.extract_tb(exc_info[3]) + stack_trace = traceback.extract_tb(exc_info[2]) message = str(exc_info[1]) Type = "Error" #using string but ideally this would be an enum value. return {"Time": {"$date": time}, "UtcTime": {"$date": utcTime}, "StackTrace": stack_trace, "Message": message, "Type": Type, "_t": "BH.oM.Base.Debugging.Event"} @@ -158,7 +158,11 @@ def wrapper(*args, **kwargs) -> Any: _id = uuid.uuid4() #for now for file IDs, generate one using the project ID - file_id = uuid.uuid3(uuid.NAMESPACE_OID, project_id()) + pid = project_id() + if pid == None: + pid = "" + + file_id = uuid.uuid3(uuid.NAMESPACE_OID, pid) # get the data being passed to the function, expected dtype and return type argspec = inspect.getfullargspec(function)[-1]