diff --git a/src/isolate/server/server.py b/src/isolate/server/server.py index 1a89470..7b9b4fd 100644 --- a/src/isolate/server/server.py +++ b/src/isolate/server/server.py @@ -329,8 +329,13 @@ def Submit( self.background_tasks[task_id] = task - def _callback(_): - print(f"Task {task_id} finished") + def _callback(future: futures.Future) -> None: + msg = f"Task {task_id} finished with" + if exc := future.exception(): + msg += f" error: {exc!r}" + else: + msg += f" result: {future.result()!r}" + print(msg) self.background_tasks.pop(task_id, None) task.future.add_done_callback(_callback)