From f1877f633810bd5b1a9333a5fe6591756da82ea4 Mon Sep 17 00:00:00 2001 From: Ponali Date: Sun, 12 Oct 2025 10:05:39 +0200 Subject: [PATCH] process crashes now output error logs --- halyde/kernel/tsched.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/halyde/kernel/tsched.lua b/halyde/kernel/tsched.lua index 0a6b1b1..d865b7a 100644 --- a/halyde/kernel/tsched.lua +++ b/halyde/kernel/tsched.lua @@ -6,10 +6,15 @@ local gpu = component.gpu local log = require("log") function handleError(errormsg) + local traceback = debug.traceback() if errormsg == nil then -- TODO: Replace with proper error handling - print("\27[91munknown error" .. "\n \n" .. debug.traceback()) + print("\27[91munknown error" .. "\n \n" .. traceback) + log.kernel.error(string.format("Process ID %d has crashed!\n\n%s", tsched.currentTask.id, traceback)) else - print("\27[91m" .. tostring(errormsg) .. "\n \n" .. debug.traceback()) + print("\27[91m" .. tostring(errormsg) .. "\n \n" .. traceback) + log.kernel.error( + string.format("Process ID %d has crashed: %s\n\n%s", tsched.currentTask.id, tostring(errormsg), traceback) + ) end end