Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Python_Engine/Python/src/python_toolkit/bhom/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down Expand Up @@ -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]
Expand Down