MCPcopy Create free account
hub / github.com/MemTensor/MemOS / error_task

Function error_task

tests/api/test_thread_context.py:158–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156 error_context = {}
157
158 def error_task():
159 try:
160 context = get_current_context()
161 error_context["trace_id"] = context.trace_id if context else None
162 error_context["test_data"] = context.test_data if context else None
163 raise ValueError("Test error")
164 except ValueError:
165 # We should still be able to access context even after error
166 context = get_current_context()
167 error_context["after_error_trace_id"] = context.trace_id if context else None
168 error_context["after_error_test_data"] = context.test_data if context else None
169 raise
170
171 thread = ContextThread(target=error_task)
172 thread.start()

Callers

nothing calls this directly

Calls 1

get_current_contextFunction · 0.90

Tested by

no test coverage detected